OSDN Git Service

bpftool: feature probing, change default action
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Thu, 24 Jan 2019 02:51:57 +0000 (11:51 +0900)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 24 Jan 2019 09:47:52 +0000 (10:47 +0100)
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_q7@lab.ntt.co.jp>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/bpf/bpftool/feature.c

index 993c6f1..d672d90 100644 (file)
@@ -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 }
 };