diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-05-24 21:59:07 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-05-25 00:05:58 +0300 |
commit | 90eea4086d5ed31936889a44d536bf77afa4ca8a (patch) | |
tree | f0e5b1940e3443bcf18943610f46e98967584e57 /tools/bpf/bpftool/bash-completion | |
parent | 220ba451124e275ff548bec33b0dc01e40895b06 (diff) | |
download | linux-90eea4086d5ed31936889a44d536bf77afa4ca8a.tar.xz |
bpftool: update bash-completion w/ new c option for btf dump
Add bash completion for new C btf dump option.
Cc: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.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 | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool index 50e402a5a9c8..75c01eafd3a1 100644 --- a/tools/bpf/bpftool/bash-completion/bpftool +++ b/tools/bpf/bpftool/bash-completion/bpftool @@ -638,11 +638,24 @@ _bpftool() esac return 0 ;; + format) + COMPREPLY=( $( compgen -W "c raw" -- "$cur" ) ) + ;; *) - if [[ $cword == 6 ]] && [[ ${words[3]} == "map" ]]; then - COMPREPLY+=( $( compgen -W 'key value kv all' -- \ - "$cur" ) ) - fi + # emit extra options + case ${words[3]} in + id|file) + _bpftool_once_attr 'format' + ;; + map|prog) + if [[ ${words[3]} == "map" ]] && [[ $cword == 6 ]]; then + COMPREPLY+=( $( compgen -W "key value kv all" -- "$cur" ) ) + fi + _bpftool_once_attr 'format' + ;; + *) + ;; + esac return 0 ;; esac |