Skip to contentSkip to conversation

perf report: Bail out if there are unrecognized options/arguments

tip:perfcounters/core tip-bot for Ingo Molnar 1 participant 1 message Jun 4, 2009 Documentation

lore
Share & tools
lore
#0 lore raw
Commit-ID:  edc52deac624e4641211a325c23da2a73b01a85d
Gitweb:     http://git.kernel.org/tip/edc52deac624e4641211a325c23da2a73b01a85d
Author:     Ingo Molnar <[email protected]>
AuthorDate: Thu, 4 Jun 2009 16:24:37 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 4 Jun 2009 16:24:37 +0200

perf report: Bail out if there are unrecognized options/arguments

Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
LKML-Reference: <new-submission>

---
 Documentation/perf_counter/builtin-report.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
Documentation/perf_counter/builtin-report.c +7 -1
index 7beedc6..389ae25 100644
@@ -1094,10 +1094,16 @@ int cmd_report(int argc, const char **argv, const char *prefix)
 
 	page_size = getpagesize();
 
-	parse_options(argc, argv, options, report_usage, 0);
+	argc = parse_options(argc, argv, options, report_usage, 0);
 
 	setup_sorting();
 
+	/*
+	 * Any (unrecognized) arguments left?
+	 */
+	if (argc)
+		usage_with_options(report_usage, options);
+
 	setup_pager();
 
 	return __cmd_report();