All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
To: mhiramat@kernel.org, jolsa@redhat.com, acme@redhat.com
Cc: kstewart@linuxfoundation.org, tglx@linutronix.de,
	pombredanne@nexb.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org, mingo@redhat.com,
	alexander.shishkin@linux.intel.com, namhyung@kernel.org,
	uneedsihyeon@gmail.com, kjlx@templeofstupid.com,
	Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: [PATCH v2 1/3] tools/parse-options: Add '\n' at the end of error messages
Date: Tue, 17 Apr 2018 09:43:44 +0530	[thread overview]
Message-ID: <20180417041346.5617-2-ravi.bangoria@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180417041346.5617-1-ravi.bangoria@linux.vnet.ibm.com>

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>
---
 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

  reply	other threads:[~2018-04-17  4:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17  4:13 [PATCH v2 0/3] perf/buildid-cache: Add --list and --purge-all options Ravi Bangoria
2018-04-17  4:13 ` Ravi Bangoria [this message]
2018-04-21  7:52   ` [tip:perf/urgent] perf tools: Add '\n' at the end of parse-options error messages tip-bot for Ravi Bangoria
2018-04-17  4:13 ` [PATCH v2 2/3] perf/buildid-cache: Support --list option Ravi Bangoria
2018-04-23  6:59   ` Masami Hiramatsu
2018-05-02 17:39   ` [tip:perf/core] perf buildid-cache: " tip-bot for Ravi Bangoria
2018-04-17  4:13 ` [PATCH v2 3/3] perf/buildid-cache: Support --purge-all option Ravi Bangoria
2018-04-23  7:02   ` Masami Hiramatsu
2018-05-03  8:54     ` Ravi Bangoria
2018-05-08 15:42       ` Masami Hiramatsu
2018-05-09  6:00         ` Ravi Bangoria
2018-04-23 18:59   ` Arnaldo Carvalho de Melo
2018-05-02 17:40   ` [tip:perf/core] perf buildid-cache: " tip-bot for Ravi Bangoria
2018-04-17  7:57 ` [PATCH v2 0/3] perf/buildid-cache: Add --list and --purge-all options Jiri Olsa
2018-04-17 13:58   ` Arnaldo Carvalho de Melo
2018-04-18  5:54 ` Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180417041346.5617-2-ravi.bangoria@linux.vnet.ibm.com \
    --to=ravi.bangoria@linux.vnet.ibm.com \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=kjlx@templeofstupid.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pombredanne@nexb.com \
    --cc=tglx@linutronix.de \
    --cc=uneedsihyeon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.