chiark / gitweb /
accelerometer: display short options too
[elogind.git] / src / udev / accelerometer / accelerometer.c
index 4513bc63c2021afd1e9dccf68a1e1795742a4dac..9c13d978705f7cf09c2504df87f35d889938e3bd 100644 (file)
 #define LONG(x) ((x)/BITS_PER_LONG)
 #define test_bit(bit, array)    ((array[LONG(bit)] >> OFF(bit)) & 1)
 
-_printf_(6,0)
-static void log_fn(struct udev *udev, int priority,
-                   const char *file, int line, const char *fn,
-                   const char *format, va_list args)
-{
-        log_metav(priority, file, line, fn, format, args);
-}
-
 typedef enum {
         ORIENTATION_UNDEFINED,
         ORIENTATION_NORMAL,
@@ -206,8 +198,8 @@ static void test_orientation(struct udev *udev,
 static void help(void)
 {
         printf("Usage: accelerometer [options] <device path>\n"
-               "  --debug         debug to stderr\n"
-               "  --help          print this help text\n\n");
+               "  -d,--debug         debug to stderr\n"
+               "  -h,--help          print this help text\n\n");
 }
 
 int main (int argc, char** argv)
@@ -233,13 +225,11 @@ int main (int argc, char** argv)
         if (udev == NULL)
                 return 1;
 
-        udev_set_log_fn(udev, log_fn);
-
         /* CLI argument parsing */
         while (1) {
                 int option;
 
-                option = getopt_long(argc, argv, "dxh", options, NULL);
+                option = getopt_long(argc, argv, "dh", options, NULL);
                 if (option == -1)
                         break;
 
@@ -247,7 +237,6 @@ int main (int argc, char** argv)
                 case 'd':
                         log_set_target(LOG_TARGET_CONSOLE);
                         log_set_max_level(LOG_DEBUG);
-                        udev_set_log_priority(udev, LOG_DEBUG);
                         log_open();
                         break;
                 case 'h':