mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 22:30:11 +01:00
nmcli: fix 'nmcli con export' parameters check
get_connection() will already move forward arguments (argc/argv):
remove extra argv++/argc--
Example:
"nmcli con export <vpn_con> <output_file> <extra_arg>"
now, extra_arg is detected, printing error:
"Error: unknown extra argument: 'extra_arg'."
(cherry picked from commit 512ed904c6)
This commit is contained in:
parent
72d5be1789
commit
ddbb63afeb
1 changed files with 1 additions and 5 deletions
|
|
@ -8756,11 +8756,7 @@ do_connection_export (NmCli *nmc, int argc, char **argv)
|
|||
if (nmc->complete)
|
||||
return nmc->return_value;
|
||||
|
||||
if (argc) {
|
||||
out_name = *argv;
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
out_name = *argv;
|
||||
|
||||
if (next_arg (nmc->ask ? NULL : nmc, argc_ptr, argv_ptr, NULL) == 0) {
|
||||
g_string_printf (nmc->return_text, _("Error: unknown extra argument: '%s'."), *argv);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue