aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uxd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/uxd.c b/uxd.c
index 9926386..316cb19 100644
--- a/uxd.c
+++ b/uxd.c
@@ -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]);
}