Commit 9d294f69 authored by Daniel Xu's avatar Daniel Xu Committed by Andrii Nakryiko
Browse files

bpftool: bash: Add bash completion for root_id argument



This commit updates the bash completion script with the new root_id
argument.

Signed-off-by: default avatarDaniel Xu <dxu@dxuuu.xyz>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/37016c786620761e621a88240e36f6cb27a8f628.1734119028.git.dxu@dxuuu.xyz
parent a812d92e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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'
                                    ;;
                                *)