2019-01-24 11:51 UTC+0900 ~ Prashant Bhole <bhole_prashant...@lab.ntt.co.jp>
When 'bpftool feature' is executed it shows incorrect help string.

test# bpftool feature
Usage: bpftool bpftool probe [COMPONENT] [macros [prefix PREFIX]]
        bpftool bpftool help

        COMPONENT := { kernel | dev NAME }

Instead of fixing the help text by tweaking argv[] indices, this
patch changes the default action to 'probe'. It makes the behavior
consistent with other subcommands, where first subcommand without
extra parameter results in 'show' action.

Signed-off-by: Prashant Bhole <bhole_prashant...@lab.ntt.co.jp>
---
  tools/bpf/bpftool/feature.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c
index 993c6f1e5473..d672d9086fff 100644
--- a/tools/bpf/bpftool/feature.c
+++ b/tools/bpf/bpftool/feature.c
@@ -753,8 +753,8 @@ static int do_help(int argc, char **argv)
  }
static const struct cmd cmds[] = {
-       { "help",     do_help },
        { "probe",    do_probe },
+       { "help",     do_help },
        { 0 }
  };

Oh, thanks! This seems to be the correct thing to do indeed.

Reviewed-by: Quentin Monnet <quentin.mon...@netronome.com>

Reply via email to