diff options
author | Quentin Monnet <quentin.monnet@netronome.com> | 2019-01-17 10:27:58 -0500 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-01-23 01:15:40 -0500 |
commit | 948703e80868a7ee00a9ca16c0e37ffe6933f9bb (patch) | |
tree | f187d5506719805e9482d6c55f83a9f2add62229 /tools/bpf/bpftool/bash-completion | |
parent | f9499fedf28547b496066b65de9180eaf3a7dc50 (diff) |
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>
Diffstat (limited to 'tools/bpf/bpftool/bash-completion')
-rw-r--r-- | tools/bpf/bpftool/bash-completion/bpftool | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool index 47143d793b33..763dd12482aa 100644 --- a/tools/bpf/bpftool/bash-completion/bpftool +++ b/tools/bpf/bpftool/bash-completion/bpftool | |||
@@ -679,6 +679,25 @@ _bpftool() | |||
679 | ;; | 679 | ;; |
680 | esac | 680 | esac |
681 | ;; | 681 | ;; |
682 | feature) | ||
683 | case $command in | ||
684 | probe) | ||
685 | [[ $prev == "dev" ]] && _sysfs_get_netdevs && return 0 | ||
686 | [[ $prev == "prefix" ]] && return 0 | ||
687 | if _bpftool_search_list 'macros'; then | ||
688 | COMPREPLY+=( $( compgen -W 'prefix' -- "$cur" ) ) | ||
689 | else | ||
690 | COMPREPLY+=( $( compgen -W 'macros' -- "$cur" ) ) | ||
691 | fi | ||
692 | _bpftool_one_of_list 'kernel dev' | ||
693 | return 0 | ||
694 | ;; | ||
695 | *) | ||
696 | [[ $prev == $object ]] && \ | ||
697 | COMPREPLY=( $( compgen -W 'help probe' -- "$cur" ) ) | ||
698 | ;; | ||
699 | esac | ||
700 | ;; | ||
682 | esac | 701 | esac |
683 | } && | 702 | } && |
684 | complete -F _bpftool bpftool | 703 | complete -F _bpftool bpftool |