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)
commitfe8ecccc10b3adc071de05ca7af728ca1a4ac9aa
treee331ea6c91c3da4fc356cbaed02d0cceff29bdbb
parent06ee9da6a8b49e0e12b7a825dbe6ad243d5463e2
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