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

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

tools: bpftool: add bash completion for CFG dump



Add bash completion for the "visual" keyword used for dumping the CFG of
eBPF programs with bpftool. Make sure we only complete with this keyword
when we dump "xlated" (and not "jited") instructions.

Acked-by: default avatarJiong Wang <jiong.wang@netronome.com>
Signed-off-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent b6c1cedb
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ _bpftool()

    # Deal with simplest keywords
    case $prev in
        help|key|opcodes)
        help|key|opcodes|visual)
            return 0
            ;;
        tag)
@@ -224,8 +224,13 @@ _bpftool()
                            ;;
                    *)
                        _bpftool_once_attr 'file'
                        if _bpftool_search_list 'xlated'; then
                            COMPREPLY+=( $( compgen -W 'opcodes visual' -- \
                                "$cur" ) )
                        else
                            COMPREPLY+=( $( compgen -W 'opcodes' -- \
                                "$cur" ) )
                        fi
                        return 0
                        ;;
                    esac