[lkml]   [2015]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/4] perf report: Rename to --show-cpu-utilization

* Namhyung Kim <> wrote:

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


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.


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>]


Which arguably isn't very helpful! :-)


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.


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.



 \ /
  Last update: 2015-10-25 10:21    [W:0.107 / U:1.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site