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 <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brendan Gregg <[email protected]> Cc: Chandler Carruth <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Wang Nan <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

