client: Factor out technologies command
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 19 Feb 2013 19:36:24 +0000 (21:36 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 21 Feb 2013 14:22:57 +0000 (16:22 +0200)
client/commands.c

index 860c94b..dd24d10 100644 (file)
@@ -194,7 +194,10 @@ static int cmd_services(char *args[], int num, struct option *options)
 
 static int cmd_technologies(char *args[], int num, struct option *options)
 {
-       return -1;
+       if (num > 1)
+               return -E2BIG;
+
+       return list_properties(connection, "GetTechnologies", NULL);
 }
 
 static int cmd_scan(char *args[], int num, struct option *options)
@@ -501,14 +504,6 @@ int commands_no_options(DBusConnection *connection, char *argv[], int argc)
                cmd_help(NULL, 0, NULL);
                printf("\nNote: arguments and output are considered "
                                "EXPERIMENTAL for now.\n\n");
-       } else if (strcmp(argv[0], "technologies") == 0) {
-               if (argc != 1) {
-                       fprintf(stderr, "Tech cannot accept an argument, "
-                                                               "see help\n");
-                       error = -EINVAL;
-               } else
-                       error = list_properties(connection,
-                                               "GetTechnologies", NULL);
        } else if (strcmp(argv[0], "connect") == 0) {
                if (argc != 2) {
                        fprintf(stderr, "Connect requires a service name or "