Fix: lttng: incorrect domain list printed when no domain is provided
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Mar 2020 23:27:28 +0000 (18:27 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 26 Mar 2020 23:07:45 +0000 (19:07 -0400)
commit2948cce504b63c05b6f56c245ebb6152cf0bd714
tree3bb73ee28607061a06e8146a6f5708518cfbe6ef
parentcea15630e95deb18545e9b52d436dee5367a9e68
Fix: lttng: incorrect domain list printed when no domain is provided

The following commands make use of a common utility function to
validate the count of domains specified and print an error when it
is invalid:
  - lttng-enable-event,
  - lttng-disable-event,
  - lttng-track,
  - lttng-untrack,
  - lttng-add-context,
  - lttng-enable-channel,
  - lttng-disable-channel.

Those commands do not allow the same domains to be used. In fact, they
all expect --kernel or --userspace only, except for the
lttng-enable-event, lttng-disable-event, and lttng-add-context
commands which allow the --log4j, --jul, and --python domain options
to be used.

Currently, the error message when no domain is specified is incorrect
for all of those commands. The error reads as follows:

`Error: Please specify a domain (-k/-u/-j).`

For most commands, the -j option cannot be used. For those that allow
agent domains, the message is missing the -l and -p domains.

This ensures that the expected domains are printed for each of those
commands.

Moreover, the message is clarified by using the long form option
names.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I45aee075dbf6c62c4120bdeb06697b88b2d8716c
src/bin/lttng/commands/add_context.c
src/bin/lttng/commands/disable_channels.c
src/bin/lttng/commands/disable_events.c
src/bin/lttng/commands/enable_channels.c
src/bin/lttng/commands/enable_events.c
src/bin/lttng/commands/track-untrack.c
src/bin/lttng/utils.c
src/bin/lttng/utils.h
This page took 0.027102 seconds and 4 git commands to generate.