diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-02-19 21:34:15 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-02-21 16:22:56 +0200 |
commit | f7feece3dcc467604a69ed9faf98886522e183b2 (patch) | |
tree | ba7aa379849cb946222aea411b529a1d045495df /client | |
parent | 168c718ea0936faa6114783877f4d02d46d95e5e (diff) | |
download | connman-f7feece3dcc467604a69ed9faf98886522e183b2.tar.gz connman-f7feece3dcc467604a69ed9faf98886522e183b2.tar.bz2 connman-f7feece3dcc467604a69ed9faf98886522e183b2.zip |
client: Factor out state command
Diffstat (limited to 'client')
-rw-r--r-- | client/commands.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/client/commands.c b/client/commands.c index 1aa27834..860c94b9 100644 --- a/client/commands.c +++ b/client/commands.c @@ -150,7 +150,10 @@ static int cmd_disable(char *args[], int num, struct option *options) static int cmd_state(char *args[], int num, struct option *options) { - return -1; + if (num > 1) + return -E2BIG; + + return list_properties(connection, "GetProperties", NULL); } static int cmd_services(char *args[], int num, struct option *options) @@ -498,14 +501,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], "state") == 0) { - if (argc != 1) { - fprintf(stderr, "State cannot accept an argument, " - "see help\n"); - error = -EINVAL; - } else - error = list_properties(connection, - "GetProperties", NULL); } else if (strcmp(argv[0], "technologies") == 0) { if (argc != 1) { fprintf(stderr, "Tech cannot accept an argument, " |