Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 948703e8 authored by Quentin Monnet's avatar Quentin Monnet Committed by Alexei Starovoitov
Browse files

tools: bpftool: add bash completion for bpftool probes



Add the bash completion related to the newly introduced "bpftool feature
probe" command.

Signed-off-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarStanislav Fomichev <sdf@google.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent f9499fed
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -679,6 +679,25 @@ _bpftool()
                    ;;
            esac
            ;;
        feature)
            case $command in
                probe)
                    [[ $prev == "dev" ]] && _sysfs_get_netdevs && return 0
                    [[ $prev == "prefix" ]] && return 0
                    if _bpftool_search_list 'macros'; then
                        COMPREPLY+=( $( compgen -W 'prefix' -- "$cur" ) )
                    else
                        COMPREPLY+=( $( compgen -W 'macros' -- "$cur" ) )
                    fi
                    _bpftool_one_of_list 'kernel dev'
                    return 0
                    ;;
                *)
                    [[ $prev == $object ]] && \
                        COMPREPLY=( $( compgen -W 'help probe' -- "$cur" ) )
                    ;;
            esac
            ;;
    esac
} &&
complete -F _bpftool bpftool