diff options
Diffstat (limited to 'src/opts.c')
| -rw-r--r-- | src/opts.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); } } |
