aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/subcmd/parse-options.c
diff options
context:
space:
mode:
authorRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>2018-04-17 00:13:44 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-04-18 14:35:51 -0400
commit66f5a0779af2a4f28b1832f6c20bc9d3b1ab1886 (patch)
tree86196421cfd148f904bc39b450148ef0a7c49618 /tools/lib/subcmd/parse-options.c
parentccbb6afe0890b09cc828373a9a5fffab40ec85df (diff)
perf tools: Add '\n' at the end of parse-options error messages
Few error messages does not have '\n' at the end and thus next prompt gets printed in the same line. Ex, linux~$ perf buildid-cache -verbose --add ./a.out Error: did you mean `--verbose` (with two dashes ?)linux~$ Fix it. Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Krister Johansen <kjlx@templeofstupid.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Cc: Sihyeon Jang <uneedsihyeon@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20180417041346.5617-2-ravi.bangoria@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/subcmd/parse-options.c')
-rw-r--r--tools/lib/subcmd/parse-options.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lib/subcmd/parse-options.c b/tools/lib/subcmd/parse-options.c
index f6a1babcbac4..cb7154eccbdc 100644
--- a/tools/lib/subcmd/parse-options.c
+++ b/tools/lib/subcmd/parse-options.c
@@ -433,7 +433,7 @@ match:
433 433
434 if (ambiguous_option) { 434 if (ambiguous_option) {
435 fprintf(stderr, 435 fprintf(stderr,
436 " Error: Ambiguous option: %s (could be --%s%s or --%s%s)", 436 " Error: Ambiguous option: %s (could be --%s%s or --%s%s)\n",
437 arg, 437 arg,
438 (ambiguous_flags & OPT_UNSET) ? "no-" : "", 438 (ambiguous_flags & OPT_UNSET) ? "no-" : "",
439 ambiguous_option->long_name, 439 ambiguous_option->long_name,
@@ -458,7 +458,7 @@ static void check_typos(const char *arg, const struct option *options)
458 return; 458 return;
459 459
460 if (strstarts(arg, "no-")) { 460 if (strstarts(arg, "no-")) {
461 fprintf(stderr, " Error: did you mean `--%s` (with two dashes ?)", arg); 461 fprintf(stderr, " Error: did you mean `--%s` (with two dashes ?)\n", arg);
462 exit(129); 462 exit(129);
463 } 463 }
464 464
@@ -466,7 +466,7 @@ static void check_typos(const char *arg, const struct option *options)
466 if (!options->long_name) 466 if (!options->long_name)
467 continue; 467 continue;
468 if (strstarts(options->long_name, arg)) { 468 if (strstarts(options->long_name, arg)) {
469 fprintf(stderr, " Error: did you mean `--%s` (with two dashes ?)", arg); 469 fprintf(stderr, " Error: did you mean `--%s` (with two dashes ?)\n", arg);
470 exit(129); 470 exit(129);
471 } 471 }
472 } 472 }