bpftool: Add `gen skeleton` BASH completions
authorAndrii Nakryiko <andriin@fb.com>
Sat, 14 Dec 2019 01:43:41 +0000 (17:43 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 15 Dec 2019 23:58:06 +0000 (15:58 -0800)
Add BASH completions for gen sub-command.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Cc: Quentin Monnet <quentin.monnet@netronome.com>
Link: https://lore.kernel.org/bpf/20191214014341.3442258-18-andriin@fb.com
tools/bpf/bpftool/bash-completion/bpftool

index 21c676a1eeb1a37160743afea22e520ce55842cb..754d8395e45115e6cd183747e44c6bb0d5e78c19 100644 (file)
@@ -839,6 +839,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)