summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-04-12 11:56:43 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-04-12 11:59:46 +1000
commit3ec8eb7f30e1b901cc9cac2376a963e50f17ea48 (patch)
treed731481555f9378632ac9ada9e2c89e057bf39c3 /tools
parent7525aea272e61df6031d77cf298645b1aa98adcf (diff)
tools: fix switch case-statement indentation
We don't indent the 'case FOO:' lines in libinput Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/shared.c260
1 files changed, 130 insertions, 130 deletions
diff --git a/tools/shared.c b/tools/shared.c
index fb2ae46e..c1ce6473 100644
--- a/tools/shared.c
+++ b/tools/shared.c
@@ -88,136 +88,136 @@ tools_parse_option(int option,
struct tools_options *options)
{
switch(option) {
- case OPT_TAP_ENABLE:
- options->tapping = 1;
- break;
- case OPT_TAP_DISABLE:
- options->tapping = 0;
- break;
- case OPT_TAP_MAP:
- if (!optarg)
- return 1;
-
- if (streq(optarg, "lrm")) {
- options->tap_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
- } else if (streq(optarg, "lmr")) {
- options->tap_map = LIBINPUT_CONFIG_TAP_MAP_LMR;
- } else {
- return 1;
- }
- break;
- case OPT_DRAG_ENABLE:
- options->drag = 1;
- break;
- case OPT_DRAG_DISABLE:
- options->drag = 0;
- break;
- case OPT_DRAG_LOCK_ENABLE:
- options->drag_lock = 1;
- break;
- case OPT_DRAG_LOCK_DISABLE:
- options->drag_lock = 0;
- break;
- case OPT_NATURAL_SCROLL_ENABLE:
- options->natural_scroll = 1;
- break;
- case OPT_NATURAL_SCROLL_DISABLE:
- options->natural_scroll = 0;
- break;
- case OPT_LEFT_HANDED_ENABLE:
- options->left_handed = 1;
- break;
- case OPT_LEFT_HANDED_DISABLE:
- options->left_handed = 0;
- break;
- case OPT_MIDDLEBUTTON_ENABLE:
- options->middlebutton = 1;
- break;
- case OPT_MIDDLEBUTTON_DISABLE:
- options->middlebutton = 0;
- break;
- case OPT_DWT_ENABLE:
- options->dwt = LIBINPUT_CONFIG_DWT_ENABLED;
- break;
- case OPT_DWT_DISABLE:
- options->dwt = LIBINPUT_CONFIG_DWT_DISABLED;
- break;
- case OPT_CLICK_METHOD:
- if (!optarg)
- return 1;
-
- if (streq(optarg, "none")) {
- options->click_method =
- LIBINPUT_CONFIG_CLICK_METHOD_NONE;
- } else if (streq(optarg, "clickfinger")) {
- options->click_method =
- LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
- } else if (streq(optarg, "buttonareas")) {
- options->click_method =
- LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
- } else {
- return 1;
- }
- break;
- case OPT_SCROLL_METHOD:
- if (!optarg)
- return 1;
-
- if (streq(optarg, "none")) {
- options->scroll_method =
- LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
- } else if (streq(optarg, "twofinger")) {
- options->scroll_method =
- LIBINPUT_CONFIG_SCROLL_2FG;
- } else if (streq(optarg, "edge")) {
- options->scroll_method =
- LIBINPUT_CONFIG_SCROLL_EDGE;
- } else if (streq(optarg, "button")) {
- options->scroll_method =
- LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN;
- } else {
- return 1;
- }
- break;
- case OPT_SCROLL_BUTTON:
- if (!optarg) {
- return 1;
- }
- options->scroll_button =
- libevdev_event_code_from_name(EV_KEY,
- optarg);
- if (options->scroll_button == -1) {
- fprintf(stderr,
- "Invalid button %s\n",
- optarg);
- return 1;
- }
- break;
- case OPT_SPEED:
- if (!optarg)
- return 1;
- options->speed = atof(optarg);
- break;
- case OPT_PROFILE:
- if (!optarg)
- return 1;
-
- if (streq(optarg, "adaptive"))
- options->profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
- else if (streq(optarg, "flat"))
- options->profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
- else
- return 1;
- break;
- case OPT_DISABLE_SENDEVENTS:
- if (!optarg)
- return 1;
-
- snprintf(options->disable_pattern,
- sizeof(options->disable_pattern),
- "%s",
- optarg);
- break;
+ case OPT_TAP_ENABLE:
+ options->tapping = 1;
+ break;
+ case OPT_TAP_DISABLE:
+ options->tapping = 0;
+ break;
+ case OPT_TAP_MAP:
+ if (!optarg)
+ return 1;
+
+ if (streq(optarg, "lrm")) {
+ options->tap_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
+ } else if (streq(optarg, "lmr")) {
+ options->tap_map = LIBINPUT_CONFIG_TAP_MAP_LMR;
+ } else {
+ return 1;
+ }
+ break;
+ case OPT_DRAG_ENABLE:
+ options->drag = 1;
+ break;
+ case OPT_DRAG_DISABLE:
+ options->drag = 0;
+ break;
+ case OPT_DRAG_LOCK_ENABLE:
+ options->drag_lock = 1;
+ break;
+ case OPT_DRAG_LOCK_DISABLE:
+ options->drag_lock = 0;
+ break;
+ case OPT_NATURAL_SCROLL_ENABLE:
+ options->natural_scroll = 1;
+ break;
+ case OPT_NATURAL_SCROLL_DISABLE:
+ options->natural_scroll = 0;
+ break;
+ case OPT_LEFT_HANDED_ENABLE:
+ options->left_handed = 1;
+ break;
+ case OPT_LEFT_HANDED_DISABLE:
+ options->left_handed = 0;
+ break;
+ case OPT_MIDDLEBUTTON_ENABLE:
+ options->middlebutton = 1;
+ break;
+ case OPT_MIDDLEBUTTON_DISABLE:
+ options->middlebutton = 0;
+ break;
+ case OPT_DWT_ENABLE:
+ options->dwt = LIBINPUT_CONFIG_DWT_ENABLED;
+ break;
+ case OPT_DWT_DISABLE:
+ options->dwt = LIBINPUT_CONFIG_DWT_DISABLED;
+ break;
+ case OPT_CLICK_METHOD:
+ if (!optarg)
+ return 1;
+
+ if (streq(optarg, "none")) {
+ options->click_method =
+ LIBINPUT_CONFIG_CLICK_METHOD_NONE;
+ } else if (streq(optarg, "clickfinger")) {
+ options->click_method =
+ LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
+ } else if (streq(optarg, "buttonareas")) {
+ options->click_method =
+ LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
+ } else {
+ return 1;
+ }
+ break;
+ case OPT_SCROLL_METHOD:
+ if (!optarg)
+ return 1;
+
+ if (streq(optarg, "none")) {
+ options->scroll_method =
+ LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
+ } else if (streq(optarg, "twofinger")) {
+ options->scroll_method =
+ LIBINPUT_CONFIG_SCROLL_2FG;
+ } else if (streq(optarg, "edge")) {
+ options->scroll_method =
+ LIBINPUT_CONFIG_SCROLL_EDGE;
+ } else if (streq(optarg, "button")) {
+ options->scroll_method =
+ LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN;
+ } else {
+ return 1;
+ }
+ break;
+ case OPT_SCROLL_BUTTON:
+ if (!optarg) {
+ return 1;
+ }
+ options->scroll_button =
+ libevdev_event_code_from_name(EV_KEY,
+ optarg);
+ if (options->scroll_button == -1) {
+ fprintf(stderr,
+ "Invalid button %s\n",
+ optarg);
+ return 1;
+ }
+ break;
+ case OPT_SPEED:
+ if (!optarg)
+ return 1;
+ options->speed = atof(optarg);
+ break;
+ case OPT_PROFILE:
+ if (!optarg)
+ return 1;
+
+ if (streq(optarg, "adaptive"))
+ options->profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
+ else if (streq(optarg, "flat"))
+ options->profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
+ else
+ return 1;
+ break;
+ case OPT_DISABLE_SENDEVENTS:
+ if (!optarg)
+ return 1;
+
+ snprintf(options->disable_pattern,
+ sizeof(options->disable_pattern),
+ "%s",
+ optarg);
+ break;
}
return 0;