diff options
Diffstat (limited to 'src/unalf.c')
| -rw-r--r-- | src/unalf.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/unalf.c b/src/unalf.c index 9a722f8..d4b5aa0 100644 --- a/src/unalf.c +++ b/src/unalf.c @@ -7,6 +7,10 @@ #include <f65.h> #include "unalf.h" +#ifndef VERSION +#define VERSION "0.0.0" +#endif + FILE *in_file, *out_file; char *in_filename, *self; opts_t opts; @@ -15,11 +19,6 @@ int exclude_count; char * const *include_globs; static void create_outdir(void); -static void usage(void) { - printf("usage: %s [-l] file.alf\n", self); - exit(1); -} - static void set_self(char *argv0) { char *p; @@ -48,6 +47,21 @@ static void create_outdir(void) { } } +void usage(void) { + extern char *usage_msg[]; + char **line; + + puts("unalf (ALF extractor) v" VERSION " by B. Watson. WTFPL."); + printf("Usage: %s -[options] <file> [wildcard ...]\n", self); + puts("Options:"); + puts(" wildcards: extract only matching files."); + + for(line = usage_msg; *line; line++) + puts(*line); + + exit(0); +} + int main(int argc, char **argv) { set_self(argv[0]); |
