diff options
author | Ramkumar Ramachandra | 2014-03-03 20:26:36 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo | 2014-03-14 18:08:41 -0300 |
commit | 09a71b97cce70551356b13b668aa1d7d6da84457 (patch) | |
tree | 47f628218b6a436fe565484a0a65360cd72c162d /tools/perf/util/parse-options.h | |
parent | 94a0793ddf7fa9890006a8dc203b985e7b120785 (diff) |
perf kvm: introduce --list-cmds for use by scripts
Introduce
$ perf kvm --list-cmds
to dump a raw list of commands for use by the completion script. In
order to do this, introduce parse_options_subcommand() for handling
subcommands as a special case in the parse-options machinery.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Acked-by: David Ahern <dsahern@gmail.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1393896396-10427-1-git-send-email-artagnon@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-options.h')
-rw-r--r-- | tools/perf/util/parse-options.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h index cbf0149cf221..d8dac8ac5f37 100644 --- a/tools/perf/util/parse-options.h +++ b/tools/perf/util/parse-options.h @@ -140,6 +140,11 @@ extern int parse_options(int argc, const char **argv, const struct option *options, const char * const usagestr[], int flags); +extern int parse_options_subcommand(int argc, const char **argv, + const struct option *options, + const char *const subcommands[], + const char *usagestr[], int flags); + extern NORETURN void usage_with_options(const char * const *usagestr, const struct option *options); @@ -148,7 +153,8 @@ extern NORETURN void usage_with_options(const char * const *usagestr, enum { PARSE_OPT_HELP = -1, PARSE_OPT_DONE, - PARSE_OPT_LIST, + PARSE_OPT_LIST_OPTS, + PARSE_OPT_LIST_SUBCMDS, PARSE_OPT_UNKNOWN, }; |