cli: use argpar for parsing help command's arguments
All straightforward, except that there is a functional change as part
of this patch. It was possible to pass multiple leftovers, and only the
first one was considered.
babeltrace2 help ctf tintin
did the same as
babeltrace2 help ctf
It now prints a beautiful error:
./src/cli/babeltrace2 help ctf tintin
ERROR: [Babeltrace CLI] (/home/smarchi/src/babeltrace/src/cli/babeltrace2.c:2564)
Command-line error: retcode=1
CAUSED BY [Babeltrace CLI] (/home/smarchi/src/babeltrace/src/cli/babeltrace2-cfg-cli-args.c:1461)
Extraneous command-line argument specified to `help` command: `tintin`.
Change-Id: I2c8f8610004d60a0844d18c9d622037cc7c1c04c Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1792 Tested-by: jenkins <jenkins@lttng.org> Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>