[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180416182516.1dcc96cae6a9028216cede5c@kernel.org>
Date: Mon, 16 Apr 2018 18:25:16 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
Cc: acme@...hat.com, mhiramat@...nel.org, kstewart@...uxfoundation.org,
tglx@...utronix.de, pombredanne@...b.com,
linux-kernel@...r.kernel.org, peterz@...radead.org,
mingo@...hat.com, alexander.shishkin@...ux.intel.com,
jolsa@...hat.com, namhyung@...nel.org, uneedsihyeon@...il.com,
kjlx@...pleofstupid.com
Subject: Re: [PATCH 1/3] tools/parse-options: Add '\n' at the end of error
messages
On Mon, 9 Apr 2018 16:36:31 +0530
Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com> wrote:
> 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.
Looks good to me.
Reviewed-by: Masami Hiramatsu <mhiramat@...nel.org>
Thanks!
>
> Signed-off-by: Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
> ---
> tools/lib/subcmd/parse-options.c | 6 +++---
> 1 file 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 @@ static int parse_long_opt(struct parse_opt_ctx_t *p, const char *arg,
>
> if (ambiguous_option) {
> 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,
> (ambiguous_flags & OPT_UNSET) ? "no-" : "",
> ambiguous_option->long_name,
> @@ -458,7 +458,7 @@ static void check_typos(const char *arg, const struct option *options)
> return;
>
> 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);
> }
>
> @@ -466,7 +466,7 @@ static void check_typos(const char *arg, const struct option *options)
> if (!options->long_name)
> continue;
> 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);
> }
> }
> --
> 2.14.3
>
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists