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>
This commit is contained in:
Ravi Bangoria 2018-04-17 09:43:44 +05:30 committed by Arnaldo Carvalho de Melo
parent ccbb6afe08
commit 66f5a0779a

View File

@ -433,7 +433,7 @@ match:
if (ambiguous_option) { if (ambiguous_option) {
fprintf(stderr, fprintf(stderr,
" Error: Ambiguous option: %s (could be --%s%s or --%s%s)", " Error: Ambiguous option: %s (could be --%s%s or --%s%s)\n",
arg, arg,
(ambiguous_flags & OPT_UNSET) ? "no-" : "", (ambiguous_flags & OPT_UNSET) ? "no-" : "",
ambiguous_option->long_name, ambiguous_option->long_name,
@ -458,7 +458,7 @@ static void check_typos(const char *arg, const struct option *options)
return; return;
if (strstarts(arg, "no-")) { if (strstarts(arg, "no-")) {
fprintf(stderr, " Error: did you mean `--%s` (with two dashes ?)", arg); fprintf(stderr, " Error: did you mean `--%s` (with two dashes ?)\n", arg);
exit(129); exit(129);
} }
@ -466,7 +466,7 @@ static void check_typos(const char *arg, const struct option *options)
if (!options->long_name) if (!options->long_name)
continue; continue;
if (strstarts(options->long_name, arg)) { if (strstarts(options->long_name, arg)) {
fprintf(stderr, " Error: did you mean `--%s` (with two dashes ?)", arg); fprintf(stderr, " Error: did you mean `--%s` (with two dashes ?)\n", arg);
exit(129); exit(129);
} }
} }