Skip to content

Commit

Permalink
tools: bpftool: add bash completion for bpftool probes
Browse files Browse the repository at this point in the history
Add the bash completion related to the newly introduced "bpftool feature
probe" command.

Signed-off-by: Quentin Monnet <[email protected]>
Reviewed-by: Jakub Kicinski <[email protected]>
Reviewed-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
  • Loading branch information
qmonnet authored and Alexei Starovoitov committed Jan 23, 2019
1 parent f9499fe commit 948703e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tools/bpf/bpftool/bash-completion/bpftool
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 948703e

Please sign in to comment.