cli: use argpar for parsing help command's arguments
authorSimon Marchi <simon.marchi@efficios.com>
Sat, 27 Jul 2019 03:37:22 +0000 (23:37 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Aug 2019 18:05:20 +0000 (14:05 -0400)
commit7551de33773160bf982dc144a97c672f4b81ee78
tree164ba19bd87762d9bf1040f1146414ecb2b12d5f
parenta87d29773902924f0fd44d415cd32221175e01c0
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>
src/cli/babeltrace2-cfg-cli-args.c
This page took 0.024148 seconds and 4 git commands to generate.