From: Julien Desfossez Date: Wed, 21 Feb 2018 21:57:36 +0000 (-0500) Subject: Fix: error out on leftover arguments X-Git-Tag: v2.11.0-rc1~384 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=68c7f6e55254fd6e54d7bb4a6c1316bb77843a6e;hp=68c7f6e55254fd6e54d7bb4a6c1316bb77843a6e;p=lttng-tools.git Fix: error out on leftover arguments All the commands currently ignore leftover arguments, this can lead to wrong usage of the commands and waste of time debugging. For example, this command enables the vpid context on all channels instead of only on the "mychan" channel: $ lttng add-context -u mychan -t vpid The correct usage is: $ lttng add-context -u -c mychan -t vpid We now output an error on leftover arguments: $ lttng add-context -u mychan -t vpid Error: Unknown argument: mychan Error: Command error Some commands accept one leftover argument (create, start, stop, destroy), so we check if there are other leftovers: $ lttng create mysess allo Error: Unknown argument: allo Error: Command error Only the snapshot command is not handled since it has a second level of command and does not consume the popt arguments. Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau ---