X-Git-Url: https://www.kengrimes.com/gitweb/?p=henge%2Fwebcc.git;a=blobdiff_plain;f=src%2Fbin%2Ftools%2Fapc.c;h=be902bd5f2f9a773683417e9b1cf6aafeb36a496;hp=de7bc344142a9c5ec6241153c8812ec0dc419fb2;hb=f3b6f51fea6877beedd0da00fa7cace4af8623fd;hpb=2dfdc5653b9f85952119122cff72320540a342d2 diff --git a/src/bin/tools/apc.c b/src/bin/tools/apc.c index de7bc34..be902bd 100644 --- a/src/bin/tools/apc.c +++ b/src/bin/tools/apc.c @@ -45,15 +45,20 @@ int main #define $($)#$ //stringifier #define MAXSTR 255 #define MAXERR "-%c allows at most " $(MAXSTR) " input characters\n", opt -#define USAGE "Usage: %s [-r root]\n", argv[0] +#define USAGE "Usage %s [-d dir_root][-o output_file][-h]\n", argv[0] +#define USAGE_LONG \ + "\tOptions:\n" \ + "\t\t-d\tRoot directory to parse from \t[./]\n" \ + "\t\t-o\tOutput filename \t\t[a.asspak]\n" \ + "\t\t-h\tPrint this help\n" #define DONE -1 { int opt; getopt: - switch (opt = getopt(argc, argv, "r:o:")) + switch (opt = getopt(argc, argv, "d:o:h-")) { case DONE: break; - case 'r' : + case 'd' : case 'o' : if (strnlen(optarg, MAXSTR) != MAXSTR) { cargs[opt] = optarg; @@ -63,6 +68,10 @@ int main default : fprintf(stderr, USAGE); exit(EXIT_FAILURE); + case 'h' : + printf(USAGE); + printf(USAGE_LONG); + exit(EXIT_SUCCESS); } if (lexer_init()) { perror("lexer");