diff options
-rw-r--r-- | uxd.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -355,7 +355,13 @@ void parse_args(int argc, char **argv) { } else { /* filename (if present) must come after all -options, and there can only be one filename. */ - if(my_optind < (argc - 1)) usage(); + if(my_optind < (argc - 1)) { + if(argv[my_optind + 1][0] == '-') + fprintf(stderr, "%s: filename must come after all options.\n", self); + else + fprintf(stderr, "%s: only one filename allowed.\n", self); + exit(1); + } open_input(argv[my_optind]); } |