]> Git Repo - linux.git/commitdiff
perf buildid-cache: Show usage with incorrect params
authorMasami Hiramatsu <[email protected]>
Fri, 27 Feb 2015 04:50:31 +0000 (13:50 +0900)
committerArnaldo Carvalho de Melo <[email protected]>
Fri, 27 Feb 2015 18:52:40 +0000 (15:52 -0300)
Show usage if no action is specified or unexpected parameter is given.
In other words, be more user friendly.

Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Hemant Kumar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/builtin-buildid-cache.c

index 04466c4ff9d78a1b452e6a2873439997ea778b21..d47a0cdc71c92a10040e34832886ba8157147349 100644 (file)
@@ -343,6 +343,11 @@ int cmd_buildid_cache(int argc, const char **argv,
        argc = parse_options(argc, argv, buildid_cache_options,
                             buildid_cache_usage, 0);
 
+       if (argc || (!add_name_list_str && !kcore_filename &&
+                    !remove_name_list_str && !purge_name_list_str &&
+                    !missing_filename && !update_name_list_str))
+               usage_with_options(buildid_cache_usage, buildid_cache_options);
+
        if (missing_filename) {
                file.path = missing_filename;
                file.force = force;
This page took 0.050707 seconds and 4 git commands to generate.