]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: fix completion for "bpftool map update"
authorQuentin Monnet <quentin.monnet@netronome.com>
Sat, 20 Oct 2018 22:01:50 +0000 (23:01 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Sun, 21 Oct 2018 18:45:14 +0000 (20:45 +0200)
commit27bb9ec3548e87ccfb719277f22e0aca7b855e6b
treee331ea6c91c3da4fc356cbaed02d0cceff29bdbb
parent9081367b3e6c093ddf2e84be2dbdd77edef051f8
tools: bpftool: fix completion for "bpftool map update"

When trying to complete "bpftool map update" commands, the call to
printf would print an error message that would show on the command line
if no map is found to complete the command line.

Fix it by making sure we have map ids to complete the line with, before
we try to print something.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/bpf/bpftool/bash-completion/bpftool