diff options
| -rw-r--r-- | TODO.txt | 5 | ||||
| -rw-r--r-- | src/opts.c | 5 |
2 files changed, 4 insertions, 6 deletions
@@ -1,8 +1,3 @@ -- fix dup message for bad opts: - $ ./unalf -X - ./unalf: invalid option -- 'X' - unalf: fatal: invalid option (try -h or --help) - - include some of Alfred's email commentary in the doc dir. - create some alf archives and hexedit them to introduce errors, make @@ -29,6 +29,9 @@ void parse_opts(int argc, char * const *argv) { int opt; char **ig; + /* don't let getopt() print error message for us. */ + opterr = 0; + while((opt = getopt(argc, argv, OPTIONS)) != -1) { switch(opt) { case 'a': opts.txtconv++; break; @@ -45,7 +48,7 @@ void parse_opts(int argc, char * const *argv) { case 'd': opts.outdir = optarg; break; case 'x': add_exclude(optarg); break; default: - fprintf(stderr, "%s: fatal: invalid option (try -h or --help)\n", self); + fprintf(stderr, "%s: fatal: invalid option '-%c' (try -h or --help)\n", self, optopt); exit(1); } } |
