From: Namhyung Kim <namhyung@kernel.org>
To: Taewoong Song <treeze.taeung@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
jolsa@redhat.com
Subject: Re: [PATCH 1/2] perf tools: Add 'perf-config' command
Date: Sun, 19 Apr 2015 12:34:48 +0900 [thread overview]
Message-ID: <20150419033448.GB10169@danjae.kornet> (raw)
In-Reply-To: <70EA4387-5059-4026-8819-039474865EEE@gmail.com>
On Sat, Apr 18, 2015 at 07:14:06PM +0900, Taewoong Song wrote:
> > On Apr 13, 2015, at 3:16 PM, Namhyung Kim <namhyung@kernel.org> wrote:
> > On Sun, Apr 12, 2015 at 11:44:48PM +0900, Taeung Song wrote:
> >> +static void check_argc(int argc, int limit)
> >> +{
> >> + if (argc >= limit && argc <= limit)
> >> + return;
> >> + error("wrong number of arguments");
> >> + usage_with_options(config_usage, config_options);
> >> +}
> >
> > I don't know why this is needed. The -a option won't need this and we
> > can support to get/set any number of config items IMHO.
> >
>
> I also think we can support to get/set any number of config items.
> But I think that ‘—list’ or ‘—all’ can need to be checked to validate argument.
> If work ‘git —list’ with other argument, error message can be printed like this.
>
> :> git config --list 134
> error: wrong number of arguments
> usage: git config [options]
>
> Config file location
> --global use global config file
> --system use system config file
> --local use repository config file
> -f, --file <file> use given config file
> --blob <blob-id> read config from given blob object
>
> …(omitted)…
>
> If don’t checking number of argument, we allow users to work a optio
> ‘-a’ or ‘-l’ with other arguments which can be weor meaningless.
> Did I misunderstand what you say?
> Or is there other way to avoid this problem ?
Then just check 'argc != 0' for -l or -a cases. The get/set won't
need it IMHO.
Thanks,
Namhyung
next prev parent reply other threads:[~2015-04-19 3:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-12 14:44 Taeung Song
2015-04-12 14:44 ` [PATCH 2/2] perf tools: Add a option 'remove' to perf-config and features which get or set a config variable Taeung Song
2015-04-13 6:55 ` Namhyung Kim
[not found] ` <6F8981BC-A058-4D84-93FC-B7CB8ADDCC53@gmail.com>
2015-04-19 3:42 ` Namhyung Kim
2015-04-13 6:16 ` [PATCH 1/2] perf tools: Add 'perf-config' command Namhyung Kim
[not found] ` <5CB87CAF-B6EE-4AE0-BC3C-45CEF14C28EC@gmail.com>
2015-04-19 3:27 ` Namhyung Kim
[not found] ` <70EA4387-5059-4026-8819-039474865EEE@gmail.com>
2015-04-19 3:34 ` Namhyung Kim [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-04-09 14:26 Taeung Song
2015-04-09 15:57 ` Arnaldo Carvalho de Melo
2015-04-10 8:53 ` Jiri Olsa
2015-04-04 17:41 Taeung Song
2015-04-07 17:57 ` Jiri Olsa
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=20150419033448.GB10169@danjae.kornet \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=treeze.taeung@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®