LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: tip-bot for Ravi Bangoria <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, jolsa@redhat.com, tglx@linutronix.de,
	pombredanne@nexb.com, uneedsihyeon@gmail.com,
	ravi.bangoria@linux.vnet.ibm.com,
	alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org,
	mhiramat@kernel.org, kstewart@linuxfoundation.org, hpa@zytor.com,
	namhyung@kernel.org, kjlx@templeofstupid.com, acme@redhat.com,
	peterz@infradead.org
Subject: [tip:perf/urgent] perf tools: Add '\n' at the end of parse-options error messages
Date: Sat, 21 Apr 2018 00:52:56 -0700	[thread overview]
Message-ID: <tip-66f5a0779af2a4f28b1832f6c20bc9d3b1ab1886@git.kernel.org> (raw)
In-Reply-To: <20180417041346.5617-2-ravi.bangoria@linux.vnet.ibm.com>

Commit-ID:  66f5a0779af2a4f28b1832f6c20bc9d3b1ab1886
Gitweb:     https://git.kernel.org/tip/66f5a0779af2a4f28b1832f6c20bc9d3b1ab1886
Author:     Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
AuthorDate: Tue, 17 Apr 2018 09:43:44 +0530
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 18 Apr 2018 15:35:51 -0300

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>
---
 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 @@ match:
 
 	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);
 		}
 	}

  reply	other threads:[~2018-04-21  7:53 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 ` [PATCH v2 1/3] tools/parse-options: Add '\n' at the end of error messages Ravi Bangoria
2018-04-21  7:52   ` tip-bot for Ravi Bangoria [this message]
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=tip-66f5a0779af2a4f28b1832f6c20bc9d3b1ab1886@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=kjlx@templeofstupid.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pombredanne@nexb.com \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=uneedsihyeon@gmail.com \
    --subject='Re: [tip:perf/urgent] perf tools: Add '\''\n'\'' at the end of parse-options error messages' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).