parse-options: make sure argh string does not have SP or _
[gitweb.git] / parse-options.c
index a5fa0b8938cb2820635bbc620b1b26cc903a6c97..c81d3a06550a1015ab0f4f7284bb48dce0293ab2 100644 (file)
@@ -375,6 +375,9 @@ static void parse_options_check(const struct option *opts)
                default:
                        ; /* ok. (usually accepts an argument) */
                }
+               if (opts->argh &&
+                   strcspn(opts->argh, " _") != strlen(opts->argh))
+                       err |= optbug(opts, "multi-word argh should use dash to separate words");
        }
        if (err)
                exit(128);