tools: fix switch case-statement indentation
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 12 Apr 2018 01:56:43 +0000 (11:56 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 12 Apr 2018 01:59:46 +0000 (11:59 +1000)
We don't indent the 'case FOO:' lines in libinput

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools/shared.c

index fb2ae46e163b2190c984223d120748493e5fcb0f..c1ce647353f5b2940741f99f584bc9550666941f 100644 (file)
@@ -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;