do not treat unknown option as directory - fixes #635

Tue, 08 Apr 2025 19:10:52 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 08 Apr 2025 19:10:52 +0200
changeset 80
55dc85743dd1
parent 79
e4592d0292e7
child 81
54515e5d60f5

do not treat unknown option as directory - fixes #635

src/cline.c file | annotate | diff | comparison | revisions
--- a/src/cline.c	Mon Apr 07 20:43:52 2025 +0200
+++ b/src/cline.c	Tue Apr 08 19:10:52 2025 +0200
@@ -245,6 +245,11 @@
         add_string(settings->regex->pattern_list, "^\\s*$");
         add_string(settings->regex->pattern_list, "$");
       }
+      /* Unknown option */
+      else if (argv[t][0] == '-') {
+        fprintf(stderr, "Unrecognized option: %s\n\n", argv[t]);
+        return exit_with_help(settings, 1);
+      }
       /* Path */
       else {
         add_string(directories, argv[t]);

mercurial