tools: bpftool: add bash completion for bpftool probes

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

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
Quentin Monnet 2019-01-17 15:27:58 +00:00 committed by Alexei Starovoitov
parent f9499fedf2
commit 948703e808

View File

@ -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