perf tools: Search for more options when passing args to -h
[deliverable/linux.git] / tools / perf / util / parse-options.c
index 230e771407a3249775fd7116161317ca9fa7cbe9..9fca09296eb3472ba2fbe06af0ac1a3f4a1f829b 100644 (file)
@@ -695,8 +695,21 @@ static bool option__in_argv(const struct option *opt, const struct parse_opt_ctx
        for (i = 1; i < ctx->argc; ++i) {
                const char *arg = ctx->argv[i];
 
-               if (arg[0] != '-')
+               if (arg[0] != '-') {
+                       if (arg[1] == '\0') {
+                               if (arg[0] == opt->short_name)
+                                       return true;
+                               continue;
+                       }
+
+                       if (opt->long_name && strcmp(opt->long_name, arg) == 0)
+                               return true;
+
+                       if (opt->help && strcasestr(opt->help, arg) != NULL)
+                               return true;
+
                        continue;
+               }
 
                if (arg[1] == opt->short_name ||
                    (arg[1] == '-' && opt->long_name && strcmp(opt->long_name, arg + 2) == 0))
This page took 0.024419 seconds and 5 git commands to generate.