tools: bpftool: add support for quotations in batch files
authorQuentin Monnet <quentin.monnet@netronome.com>
Fri, 2 Mar 2018 04:20:11 +0000 (20:20 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 2 Mar 2018 08:46:41 +0000 (09:46 +0100)
commit668da745af3c29d5742238ef278a1b2055c97e51
treec8e83f9d29604d555bb56e38a8161ee8a6123217
parent416656bbaa57a5be75514498491b7e24c58537c1
tools: bpftool: add support for quotations in batch files

Improve argument parsing from batch input files in order to support
arguments enclosed between single (') or double quotes ("). For example,
this command can now be parsed in batch mode:

    bpftool prog dump xlated id 1337 file "/tmp/my file with spaces"

The function responsible for parsing command arguments is copied from
its counterpart in lib/utils.c in iproute2 package.

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