summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-01-18 13:20:58 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-01-20 07:41:58 +1000
commit9e8d95799a31f297065f1b3ce346a2567b7cc07a (patch)
treeb81f28f2ccbb220d9928ff39c3bc56db80c5e51c /src
parent976c989af7978277061d0166d8e2a82cb8b1e795 (diff)
Fix broken "xinput list <devicename>".
Default behaviour for --list is to list --short if no device is given and --long if a device is given. Restore this behaviour. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dirk Wallenstein <halsmit@t-online.de> Tested-by: Dirk Wallenstein <halsmit@t-online.de>
Diffstat (limited to 'src')
-rw-r--r--src/list.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/list.c b/src/list.c
index ca3c6bf..b3bf873 100644
--- a/src/list.c
+++ b/src/list.c
@@ -25,6 +25,7 @@
#include <string.h>
enum print_format {
+ FORMAT_NONE,
FORMAT_SHORT,
FORMAT_LONG,
FORMAT_NAME,
@@ -315,8 +316,8 @@ list(Display *display,
char *name,
char *desc)
{
- enum print_format format = FORMAT_SHORT;
- int arg_dev = 0;
+ enum print_format format = FORMAT_NONE;
+ int arg_dev = 1;
if (argc >= 1)
{
@@ -328,11 +329,14 @@ list(Display *display,
format = FORMAT_NAME;
else if (strcmp(argv[0], "--id-only") == 0)
format = FORMAT_ID;
- arg_dev++;
+ else
+ arg_dev--;
}
if (argc > arg_dev)
{
+ if (format == FORMAT_NONE)
+ format = FORMAT_LONG;
#ifdef HAVE_XI2
if (xinput_version(display) == XI_2_Major)
{
@@ -359,6 +363,8 @@ list(Display *display,
}
}
} else {
+ if (format == FORMAT_NONE)
+ format = FORMAT_SHORT;
#ifdef HAVE_XI2
if (xinput_version(display) == XI_2_Major)
return list_xi2(display, format);