]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bpftool: Add bash completion for token argument
authorTao Chen <chen.dylane@linux.dev>
Wed, 23 Jul 2025 14:44:42 +0000 (22:44 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 2 Aug 2025 01:03:23 +0000 (18:03 -0700)
This commit updates the bash completion script with the
new token argument.
$ bpftool token
help  list  show

Reviewed-by: Quentin Monnet <qmo@kernel.org>
Signed-off-by: Tao Chen <chen.dylane@linux.dev>
Link: https://lore.kernel.org/r/20250723144442.1427943-3-chen.dylane@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/bash-completion/bpftool

index a759ba24471d67f5dd4aad4987dccde9a0f4e442..527bb47ac4629db894f5b65a06d4d93b329e2fb2 100644 (file)
@@ -1215,6 +1215,17 @@ _bpftool()
                     ;;
             esac
             ;;
+        token)
+            case $command in
+               show|list)
+                   return 0
+                   ;;
+               *)
+                   [[ $prev == $object ]] && \
+                       COMPREPLY=( $( compgen -W 'help show list' -- "$cur" ) )
+                   ;;
+            esac
+            ;;
     esac
 } &&
 complete -F _bpftool bpftool