]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bpftool: bash: Add bash completion for root_id argument
authorDaniel Xu <dxu@dxuuu.xyz>
Fri, 13 Dec 2024 19:44:12 +0000 (12:44 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 13 Dec 2024 22:35:42 +0000 (14:35 -0800)
This commit updates the bash completion script with the new root_id
argument.

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/37016c786620761e621a88240e36f6cb27a8f628.1734119028.git.dxu@dxuuu.xyz
tools/bpf/bpftool/bash-completion/bpftool

index 0c541498c301bedca9a061fddcdb8b7d06a5a1f1..1ce409a6cbd91fde26daa3df3084d7e544e59193 100644 (file)
@@ -930,19 +930,24 @@ _bpftool()
                         format)
                             COMPREPLY=( $( compgen -W "c raw" -- "$cur" ) )
                             ;;
+                        root_id)
+                            return 0;
+                            ;;
                         c)
-                            COMPREPLY=( $( compgen -W "unsorted" -- "$cur" ) )
+                            COMPREPLY=( $( compgen -W "unsorted root_id" -- "$cur" ) )
                             ;;
                         *)
                             # emit extra options
                             case ${words[3]} in
                                 id|file)
+                                    COMPREPLY=( $( compgen -W "root_id" -- "$cur" ) )
                                     _bpftool_once_attr 'format'
                                     ;;
                                 map|prog)
                                     if [[ ${words[3]} == "map" ]] && [[ $cword == 6 ]]; then
                                         COMPREPLY+=( $( compgen -W "key value kv all" -- "$cur" ) )
                                     fi
+                                    COMPREPLY=( $( compgen -W "root_id" -- "$cur" ) )
                                     _bpftool_once_attr 'format'
                                     ;;
                                 *)