All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Paul Mackerras <paulus@samba.org>, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>, Borislav Petkov <bp@suse.de>,
	Hemant Kumar <hemant@linux.vnet.ibm.com>
Subject: [perf/core PATCH v6 3/3] perf-buildid-cache: Show usage with incorrect params
Date: Fri, 27 Feb 2015 13:50:31 +0900	[thread overview]
Message-ID: <20150227045030.1999.44006.stgit@localhost.localdomain> (raw)
In-Reply-To: <20150227045024.1999.38983.stgit@localhost.localdomain>

Show usage if no action is specified or unexpected parameter
is given. In other words, be more user friendly.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---
 tools/perf/builtin-buildid-cache.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index 04466c4..d47a0cd 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -343,6 +343,11 @@ int cmd_buildid_cache(int argc, const char **argv,
 	argc = parse_options(argc, argv, buildid_cache_options,
 			     buildid_cache_usage, 0);
 
+	if (argc || (!add_name_list_str && !kcore_filename &&
+		     !remove_name_list_str && !purge_name_list_str &&
+		     !missing_filename && !update_name_list_str))
+		usage_with_options(buildid_cache_usage, buildid_cache_options);
+
 	if (missing_filename) {
 		file.path = missing_filename;
 		file.force = force;


  parent reply	other threads:[~2015-02-27  4:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27  4:50 [perf/core PATCH v6 0/3] perf-buildid-cache: Enhance --update and add --purge Masami Hiramatsu
2015-02-27  4:50 ` [perf/core PATCH v6 1/3] perf buildid-cache: Add --purge FILE to remove all caches of FILE Masami Hiramatsu
2015-02-28  9:34   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2015-02-27  4:50 ` [perf/core PATCH v6 2/3] perf-buildid-cache: Use pr_debug instead of verbose && pr_info Masami Hiramatsu
2015-02-28  9:35   ` [tip:perf/core] perf buildid-cache: " tip-bot for Masami Hiramatsu
2015-02-27  4:50 ` Masami Hiramatsu [this message]
2015-02-28  9:35   ` [tip:perf/core] perf buildid-cache: Show usage with incorrect params tip-bot for Masami Hiramatsu
2015-02-27 15:32 ` [perf/core PATCH v6 0/3] perf-buildid-cache: Enhance --update and add --purge Arnaldo Carvalho de Melo

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=20150227045030.1999.44006.stgit@localhost.localdomain \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=bp@suse.de \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    /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.