linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Jiri Olsa <jolsa@redhat.com>, LKML <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH 2/4] perf report: Rename to --show-cpu-utilization
Date: Sun, 25 Oct 2015 09:59:06 +0100	[thread overview]
Message-ID: <20151025085906.GC24337@gmail.com> (raw)
In-Reply-To: <1445701767-12731-2-git-send-email-namhyung@kernel.org>


* Namhyung Kim <namhyung@kernel.org> wrote:

> So that it can be more consistent with other --show-* options.  The old
> name (--showcpuutilization) is provided only for compatibility.

1)

Btw., maybe we could enhance the option parser to strip all (non-leading) dashes 
from long-form option names? That way both variants would work naturally, and if 
someone thinks it's called '--show-cpuutilization' that would work as well.

2)

Also, another enhancement would be to allow partial matches, so that --showcpu 
would match on the first long-form option name that matches.

Right now we do:

  triton:~/tip> perf report -h --showcpu

   Usage: perf report [<options>]


  triton:~/tip> 

Which arguably isn't very helpful! :-)

3)

The only drawback of doing partial matches would be if we introduce new variants - 
but we'd still 'break' safely: if for example --show-cpu-usage is introduced in a 
couple of years, then previous usage of:

   perf report --showcpu

would emit your ambiguous-options warning that you improved in this series. We'd 
output the two options that match and the user could adjust the parameter to 
whichever he meant.

It would still very smooth behavior from a UI ergonomy POV IMHO.

4)

Another possible tweak would be to print a non-fatal info line when a user didn't 
use the canonical form of the option. So writing:

   perf report --showcpu

would result in (stdout) output like this:

   # Option parser: '--showcpu' matched on '--show-cpu-utilization'

The disadvantage of this would be the extra nuisance factor, so I'm not sure we 
want this aspect.

Thanks,

	Ingo

  reply	other threads:[~2015-10-25  8:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-24 15:49 [PATCH 1/4] perf tools: Improve ambiguous option help message Namhyung Kim
2015-10-24 15:49 ` [PATCH 2/4] perf report: Rename to --show-cpu-utilization Namhyung Kim
2015-10-25  8:59   ` Ingo Molnar [this message]
2015-10-29  9:39   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-10-24 15:49 ` [PATCH 3/4] perf tools: Setup pager when printing usage and help Namhyung Kim
2015-10-25  9:04   ` Ingo Molnar
2015-10-29  9:40   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-10-24 15:49 ` [PATCH 4/4] perf tools: Introduce usage_with_options_msg() Namhyung Kim
2015-10-26 17:13   ` Arnaldo Carvalho de Melo
2015-10-26 23:13   ` 平松雅巳 / HIRAMATU,MASAMI
2015-10-27 12:29     ` Arnaldo Carvalho de Melo
2015-10-29  9:40   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-10-25  8:48 ` [PATCH 1/4] perf tools: Improve ambiguous option help message Ingo Molnar
2015-10-29  9:39 ` [tip:perf/core] " tip-bot for Namhyung Kim

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=20151025085906.GC24337@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.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 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).