diff options
author | Bryce Harrington <bryce@canonical.com> | 2011-11-29 17:33:23 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-11-30 15:25:23 +1000 |
commit | b8f54d5c5874827fa24970029a23be06fe02bca1 (patch) | |
tree | cf57673dca1a83d83491f7ddaf9d5b1626b43714 | |
parent | 01ea71c11d1eae6787ae16ef4044c7d2b34e1800 (diff) |
xinput: Assume 'list' by default if no args given.
xrandr lists all outputs by default when run with no args. So, make
xinput list all inputs by default when run the same way, so the tools
are consistent.
Signed-off-by: Bryce Harrington <bryce@canonical.com>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/xinput.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/xinput.c b/src/xinput.c index 1ed0c8c..27fb23e 100644 --- a/src/xinput.c +++ b/src/xinput.c @@ -346,14 +346,13 @@ main(int argc, char * argv[]) char *func; int event, error; - if (argc < 2) { - usage(); - return EXIT_FAILURE; + if (argc > 1) { + func = argv[1]; + while(func[0] == '-') func++; + } else { + func = "list"; } - func = argv[1]; - while((*func) == '-') func++; - if (strcmp("version", func) == 0) { return print_version(argv[0]); } |