Add BASH completions for gen sub-command. Cc: Quentin Monnet <quentin.monnet@xxxxxxxxxxxxx> Signed-off-by: Andrii Nakryiko <andriin@xxxxxx> --- tools/bpf/bpftool/bash-completion/bpftool | 11 +++++++++++ tools/bpf/bpftool/main.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool index 70493a6da206..986519cc58d1 100644 --- a/tools/bpf/bpftool/bash-completion/bpftool +++ b/tools/bpf/bpftool/bash-completion/bpftool @@ -716,6 +716,17 @@ _bpftool() ;; esac ;; + gen) + case $command in + skeleton) + _filedir + ;; + *) + [[ $prev == $object ]] && \ + COMPREPLY=( $( compgen -W 'skeleton help' -- "$cur" ) ) + ;; + esac + ;; cgroup) case $command in show|list|tree) diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c index 758b294e8a7d..1fe91c558508 100644 --- a/tools/bpf/bpftool/main.c +++ b/tools/bpf/bpftool/main.c @@ -58,7 +58,7 @@ static int do_help(int argc, char **argv) " %s batch file FILE\n" " %s version\n" "\n" - " OBJECT := { prog | map | cgroup | perf | net | feature | btf }\n" + " OBJECT := { prog | map | cgroup | perf | net | feature | btf | gen }\n" " " HELP_SPEC_OPTIONS "\n" "", bin_name, bin_name, bin_name); -- 2.17.1