linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf tools: Setup pager when printing usage and help
@ 2015-10-22 14:28 Namhyung Kim
  2015-10-22 14:28 ` [PATCH 2/2] perf tools: Improve call graph documents and help messages Namhyung Kim
  2015-10-22 14:41 ` [PATCH 1/2] perf tools: Setup pager when printing usage and help Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 13+ messages in thread
From: Namhyung Kim @ 2015-10-22 14:28 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern,
	Adrian Hunter, Borislav Petkov, Brendan Gregg, Chandler Carruth,
	Frederic Weisbecker, Stephane Eranian, Wang Nan

It's annoying to see error or help message when command has many options
like in perf record, report or top.  So setup pager when print parser
error or help message - it should be OK since no UI is enabled at the
parsing time.  The usage_with_options() already disables it by calling
exit_browser() anyway.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/parse-options.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/parse-options.c b/tools/perf/util/parse-options.c
index 8aa7922397a9..388d385df5ad 100644
--- a/tools/perf/util/parse-options.c
+++ b/tools/perf/util/parse-options.c
@@ -648,6 +648,8 @@ int usage_with_options_internal(const char * const *usagestr,
 	if (!usagestr)
 		return PARSE_OPT_HELP;
 
+	setup_pager();
+
 	fprintf(stderr, "\n Usage: %s\n", *usagestr++);
 	while (*usagestr && **usagestr)
 		fprintf(stderr, "    or: %s\n", *usagestr++);
-- 
2.6.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-10-25  9:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-22 14:28 [PATCH 1/2] perf tools: Setup pager when printing usage and help Namhyung Kim
2015-10-22 14:28 ` [PATCH 2/2] perf tools: Improve call graph documents and help messages Namhyung Kim
2015-10-22 14:46   ` Arnaldo Carvalho de Melo
2015-10-22 16:05     ` Namhyung Kim
2015-10-22 16:26       ` Arnaldo Carvalho de Melo
2015-10-22 16:28   ` Frederic Weisbecker
2015-10-22 18:37   ` Arnaldo Carvalho de Melo
2015-10-23  8:31   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-10-23  9:03     ` Ingo Molnar
2015-10-24 15:52       ` Namhyung Kim
2015-10-25  9:19         ` Ingo Molnar
2015-10-22 14:41 ` [PATCH 1/2] perf tools: Setup pager when printing usage and help Arnaldo Carvalho de Melo
2015-10-22 15:58   ` Namhyung Kim

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