tools: shorten the --help output for the commands
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 19 Jun 2017 07:13:38 +0000 (17:13 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 22 Jun 2017 07:48:12 +0000 (17:48 +1000)
The full information is now in the man page, the usage() now just tells you
how to use it. This way there's only one place to maintain it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools/libinput-debug-events.1
tools/libinput-debug-gui.1
tools/libinput-list-devices.c
tools/libinput-measure-touchpad-tap.c
tools/libinput-measure.c
tools/libinput-tool.c
tools/shared.c

index ab95fc317e487ddae73ae928e7d42bacec296ce3..f29ae95e661745bb77f6be02bb79bec28423eb62 100644 (file)
@@ -2,7 +2,7 @@
 .SH NAME
 libinput\-debug\-events \- debug helper for libinput
 .SH SYNOPSIS
-.B libinput debug\-events [\-\-help] [\-\-show\-keycodes]
+libinput debug\-events [\-\-help] [\-\-show\-keycodes] [\-\-udev [<seat>]|\-\-device /dev/input/event0] [configuration options]
 .SH DESCRIPTION
 .PP
 The
@@ -16,17 +16,69 @@ This tool usually needs to be run as root to have access to the
 /dev/input/eventX nodes.
 .SH OPTIONS
 .TP 8
+.B \-\-device /dev/input/event0
+Use the given device with the path backend.
+.TP 8
+.B \-\-grab
+Exclusively grab all opened devices. This will prevent events from being
+delivered to the host system.
+.TP 8
 .B \-\-help
 Print help
 .TP 8
+.B \-\-quiet
+Only print libinput messages, don't print anything from this tool. This is
+useful in combination with --verbose for internal state debugging.
+.TP 8
 .B \-\-show\-keycodes
 Key events shown by this tool are partially obfuscated to avoid passwords
 and other sensitive information showing up in the output. Use the
 .B \-\-show\-keycodes
 argument to make all keycodes visible.
-.PP
-For all other options, see the output from \-\-help. Options may be added or
-removed at any time.
+.TP 8
+.B \-\-udev [<seat>]
+Use the udev backend to listen for device notifications. If a seat is given,
+use that seat, otherwise default to "seat0".
+.TP 8
+.B \-\-verbose
+Use verbose output
+.SS libinput configuration options
+.TP 8
+.B \-\-enable\-tap|\-\-disable\-tap
+Enable or disable tap-to-click.
+.TP 8
+.B \-\-enable-drag|\-\-disable\-drag
+Enable or disable tap-and-drag
+.TP 8
+.B \-\-enable\-drag-lock|\-\-disable\-drag\-lock
+Enable or disable tap-and-drag.
+.TP 8
+.B \-\-enable\-natural\-scrolling|\-\-disable\-natural\-scrolling
+Enable or disable natural scrolling.
+.TP 8
+.B \-\-enable\-left\-handed|\-\-disable\-left\-handed
+Enable or disable left handed button configuration.
+.TP 8
+.B \-\-enable\-dwt|\-\-disable\-dwt
+Enable or disable disable-while-typing.
+.TP 8
+.B \-\-set\-click\-method=[none|clickfinger|buttons]
+Set the desired click method
+.TP 8
+.B \-\-set\-scroll\-method=[none|twofinger|edge|button]
+Set the desired scroll method.
+.TP 8
+.B \-\-set\-scroll\-button=BTN_MIDDLE
+Set the button to the given button code.
+.TP 8
+.B \-\-set\-profile=[adaptive|flat]
+Set pointer acceleration profile.
+.TP 8
+.B \-\-set\-speed=<value>
+Set pointer acceleration speed. The allowed range is [-1, 1].
+.TP 8
+.B \-\-set\-tap\-map=[lrm|lmr]
+Set button mapping for tapping.
 .SH NOTES
 .PP
 Events shown by this tool may not correspond to the events seen by a
index e6d4d21fdb33be23d308d5bdf780235b2827c9ac..59a796ab30c24e78ce204d9d6d7895a90f538829 100644 (file)
@@ -2,7 +2,7 @@
 .SH NAME
 libinput\-debug\-gui \- visual debug helper for libinput
 .SH SYNOPSIS
-.B libinput debug\-gui [\-\-help]
+.B libinput debug\-gui [\-\-help] [\-\-udev [<seat>]|\-\-device /dev/input/event0] [configuration options]
 .SH DESCRIPTION
 .PP
 The
@@ -10,6 +10,7 @@ The
 tool creates a libinput context and a full-screen GTK window to visualize
 events processed by libinput. This tool exclusively grabs pointing devices
 and stops them from interacting with the rest of the GUI.
+.PP
 .B Hit Esc to exit this tool.
 .PP
 This is a debugging tool only, its output or behavior may change at any
@@ -19,11 +20,28 @@ This tool usually needs to be run as root to have access to the
 /dev/input/eventX nodes.
 .SH OPTIONS
 .TP 8
+.B \-\-device /dev/input/event0
+Use the given device with the path backend.
+.TP 8
+.B \-\-grab
+Exclusively grab all opened devices. This will prevent events from being
+delivered to the host system.
+.TP 8
 .B \-\-help
 Print help
+.TP 8
+.B \-\-quiet
+Only print libinput messages, don't print anything from this tool. This is
+useful in combination with --verbose for internal state debugging.
+.TP 8
+.B \-\-udev [<seat>]
+Use the udev backend to listen for device notifications. If a seat is given,
+use that seat, otherwise default to "seat0".
+.TP 8
+.B \-\-verbose
+Use verbose output
 .PP
-For all other options, see the output from \-\-help. Options may be added or
-removed at any time.
+For libinput configuration options, see libinput-debug-events(1)
 .SH NOTES
 .PP
 Events shown by this tool may not correspond to the events seen by a
index 2e19c010e98e6f2c417142568551dc2521dbed55..b98bb78a8e48765f843331b03a015e5284a48c77 100755 (executable)
@@ -354,17 +354,11 @@ print_device_notify(struct libinput_event *ev)
 static inline void
 usage(void)
 {
-       printf("Usage: libinput list-devices [--help]\n");
+       printf("Usage: libinput list-devices [--help|--version]\n");
        printf("\n"
-              "This tool creates a libinput context on the default seat \"seat0\"\n"
-              "and lists all devices recognized by libinput and the configuration options.\n"
-              "Where multiple options are possible, the default is prefixed with \"*\".\n"
-              "\n"
-              "Options:\n"
-              "--help ...... show this help\n"
-              "--version ... show version information\n"
-              "\n"
-              "This tool requires access to the /dev/input/eventX nodes.\n");
+              "--help ...... show this help and exit\n"
+              "--version ... show version information and exit\n"
+              "\n");
 }
 
 int
@@ -374,6 +368,8 @@ main(int argc, char **argv)
        struct tools_context context;
        struct libinput_event *ev;
 
+       /* This is kept for backwards-compatibility with the old
+          libinput-list-devices */
        if (argc > 1) {
                if (streq(argv[1], "--help")) {
                        usage();
index 6064d61e6cb885899c3ede29000acd369a48a99f..0b2b195fd14313c790ef9525d9ce42221fdbc792 100644 (file)
@@ -420,15 +420,6 @@ static inline void
 usage(void)
 {
        printf("Usage: libinput measure touchpad-tap [--help] [/dev/input/event0]\n");
-       printf("\n"
-              "Measure various properties related to tap-to-click.\n"
-              "If a path to the device is provided, that device is used. Otherwise, this tool\n"
-              "will pick the first suitable touchpad device.\n"
-              "\n"
-              "Options:\n"
-              "--help ...... show this help\n"
-              "\n"
-              "This tool requires access to the /dev/input/eventX nodes.\n");
 }
 
 int
index af9c1cfbfff3faf963c1dc4a07ce3369350971a9..9b489ed2b25480e3dca3f56ef03b5389f1a2ba9f 100644 (file)
 static inline void
 usage(void)
 {
-       printf("Usage: libinput measure [--help] FEATURE [/dev/input/event0]\n");
-       printf("\n"
-              "Collect measurements related to FEATURE on the given device.\n"
-              "\n"
-              "Options:\n"
-              "--help ...... show this help\n"
-              "\n"
-              "Available features are:\n"
-              "  touchpad-tap-time\n"
-              "        Measures the time for tap-to-click interactions\n"
-              "     "
-              "For information about each feature, see the --help output for that feature.\n"
-              "\n"
-              "This tool requires access to the /dev/input/eventX nodes.\n");
+       printf("Usage: libinput measure [--help] <feature> [/dev/input/event0]\n");
 }
 
 int
index aa07c42fd1f2d4700d4abf64cc6e36094c7f6568..5c605a374326d4dfc0386f88f28518f1ccbe4d23 100644 (file)
 static void
 usage(void)
 {
-       printf("Usage: libinput [GLOBAL OPTIONS] [COMMAND] [ARGS]\n"
-              "\n"
-              "This tool creates a libinput context and interacts with that context.\n"
-              "For detailed information about the options below, see the"
-              "libinput(1) man page.\n"
-              "\n"
-              "This tool usually requires access to the /dev/input/eventX nodes.\n"
+       printf("Usage: libinput [--help|--version] <command> [<args>]\n"
               "\n"
               "Global options:\n"
-              "  --help ...... show this help\n"
-              "  --version ... show version information\n"
-              "  --verbose ... enable verbose output for debugging\n"
-              "  --quiet ..... reduce output (may be used with --verbose)\n"
+              "  --help ...... show this help and exit\n"
+              "  --version ... show version information and exit\n"
               "\n"
               "Commands:\n"
               "  list-devices\n"
@@ -63,8 +55,8 @@ usage(void)
               "  debug-gui\n"
               "        Display a simple GUI to visualize libinput's events.\n"
               "\n"
-              "  measure\n"
-              "        Measure various device properties. See the --help output for more info\n"
+              "  measure <feature>\n"
+              "        Measure various device properties. See the man page for more info\n"
               "\n");
 }
 
index 5eaca3fc6b7061bf5a2827804ebc54a706ada9ff..7df9f6839d80d05725f3c3e022864bdb3ab3ca20 100644 (file)
@@ -97,41 +97,6 @@ tools_usage(const char *command)
 {
        printf("Usage: libinput %s [options] [--udev [<seat>]|--device /dev/input/event0]\n",
               command);
-       printf("--udev <seat>.... Use udev device discovery (default).\n"
-              "                  Specifying a seat ID is optional.\n"
-              "--device /path/to/device .... open the given device only\n"
-              "\n"
-              "Features:\n"
-              "--enable-tap\n"
-              "--disable-tap.... enable/disable tapping\n"
-              "--enable-drag\n"
-              "--disable-drag.... enable/disable tap-n-drag\n"
-              "--enable-drag-lock\n"
-              "--disable-drag-lock.... enable/disable tapping drag lock\n"
-              "--enable-natural-scrolling\n"
-              "--disable-natural-scrolling.... enable/disable natural scrolling\n"
-              "--enable-left-handed\n"
-              "--disable-left-handed.... enable/disable left-handed button configuration\n"
-              "--enable-middlebutton\n"
-              "--disable-middlebutton.... enable/disable middle button emulation\n"
-              "--enable-dwt\n"
-              "--disable-dwt..... enable/disable disable-while-typing\n"
-              "--set-click-method=[none|clickfinger|buttonareas] .... set the desired click method\n"
-              "--set-scroll-method=[none|twofinger|edge|button] ... set the desired scroll method\n"
-              "--set-scroll-button=BTN_MIDDLE ... set the button to the given button code\n"
-              "--set-profile=[adaptive|flat].... set pointer acceleration profile\n"
-              "--set-speed=<value>.... set pointer acceleration speed (allowed range [-1, 1]) \n"
-              "--set-tap-map=[lrm|lmr] ... set button mapping for tapping\n"
-              "--show-keycodes.... show all key codes while typing\n"
-              "\n"
-              "These options apply to all applicable devices, if a feature\n"
-              "is not explicitly specified it is left at each device's default.\n"
-              "\n"
-              "Other options:\n"
-              "--grab .......... Exclusively grab all openend devices\n"
-              "--help .......... Print this help.\n"
-              "--verbose ....... Print debugging output.\n"
-              "--quiet ......... Only print libinput messages, useful in combination with --verbose.\n");
 }
 
 void