Skip to content

Commit

Permalink
bpftool: feature probing, change default action
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Prashant Bhole authored and Daniel Borkmann committed Jan 24, 2019
1 parent 923cefe commit 866e6ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/bpf/bpftool/feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
};

Expand Down

0 comments on commit 866e6ac

Please sign in to comment.