cli: remove iface keyword for 'nmcli device disconnect'

'nmcli disconnect' allows specifying only one interface at a time.
This commit is contained in:
Jiří Klimeš
2013-04-02 19:18:32 +02:00
committed by Dan Williams
parent 60f54cd65d
commit 51f055f74c

View File

@@ -263,7 +263,7 @@ usage (void)
#endif
" status\n"
" list [iface <iface>]\n"
" disconnect iface <iface> [--nowait] [--timeout <timeout>]\n"
" disconnect <iface> [--nowait] [--timeout <timeout>]\n"
" wifi [list [iface <iface>] [bssid <BSSID>]]\n"
" wifi connect <(B)SSID> [password <password>] [wep-key-type key|phrase] [iface <iface>] [bssid <BSSID>] [name <name>]\n"
" [--private] [--nowait] [--timeout <timeout>]\n"
@@ -1185,16 +1185,18 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv)
goto error;
}
} else {
while (argc > 0) {
if (strcmp (*argv, "iface") == 0) {
if (next_arg (&argc, &argv) != 0) {
g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
iface = *argv;
}
if (!iface) {
g_string_printf (nmc->return_text, _("Error: No interface specified."));
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto error;
}
next_arg (&argc, &argv);
iface = *argv;
} else if (strcmp (*argv, "--nowait") == 0) {
while (argc > 0) {
if (strcmp (*argv, "--nowait") == 0) {
wait = FALSE;
} else if (strcmp (*argv, "--timeout") == 0) {
if (next_arg (&argc, &argv) != 0) {
@@ -1212,18 +1214,13 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv)
}
} else {
fprintf (stderr, _("Unknown parameter: %s\n"), *argv);
g_string_printf (nmc->return_text, _("Error: unknown argument '%s'."), *argv);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto error;
}
next_arg (&argc, &argv);
}
}
if (!iface) {
g_string_printf (nmc->return_text, _("Error: No interface specified."));
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto error;
}
nmc->get_client (nmc);