mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
perf tools: Introduce usage_with_options_msg()
Now usage_with_options() setup a pager before printing message so normal printf() or pr_err() will not be shown. The usage_with_options_msg() can be used to print some help message before usage strings. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1445701767-12731-4-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
01b19455c0
commit
c711836972
9 changed files with 62 additions and 28 deletions
|
@ -1767,9 +1767,9 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
|
|||
rep_script_path = get_script_path(argv[0], REPORT_SUFFIX);
|
||||
|
||||
if (!rec_script_path && !rep_script_path) {
|
||||
fprintf(stderr, " Couldn't find script %s\n\n See perf"
|
||||
usage_with_options_msg(script_usage, options,
|
||||
"Couldn't find script `%s'\n\n See perf"
|
||||
" script -l for available scripts.\n", argv[0]);
|
||||
usage_with_options(script_usage, options);
|
||||
}
|
||||
|
||||
if (is_top_script(argv[0])) {
|
||||
|
@ -1780,10 +1780,10 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
|
|||
rep_args = has_required_arg(rep_script_path);
|
||||
rec_args = (argc - 1) - rep_args;
|
||||
if (rec_args < 0) {
|
||||
fprintf(stderr, " %s script requires options."
|
||||
usage_with_options_msg(script_usage, options,
|
||||
"`%s' script requires options."
|
||||
"\n\n See perf script -l for available "
|
||||
"scripts and options.\n", argv[0]);
|
||||
usage_with_options(script_usage, options);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue