mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 06:50:10 +01:00
nmcli: manage "--ask connection add" with no args
When parsing arguments of "connection add" we first read the available property-value pairs and then check if the --ask option was passed in order to aid in the fill process of a new connection. Anyway, if there are no property-value tuples at all, we don't even check the --ask option, returning with error. Fix this just checking if any arg is there (argc) before invoking read_connection_properties().
This commit is contained in:
parent
0172c1ed2d
commit
93e1e65467
1 changed files with 2 additions and 2 deletions
|
|
@ -4639,8 +4639,8 @@ do_connection_add (NmCli *nmc, int argc, char **argv)
|
|||
nm_connection_add_setting (connection, NM_SETTING (s_con));
|
||||
|
||||
read_properties:
|
||||
/* Get the argument from the command line. */
|
||||
if (!read_connection_properties (nmc, connection, &argc, &argv, &error)) {
|
||||
/* Get the arguments from the command line if any */
|
||||
if (argc && !read_connection_properties (nmc, connection, &argc, &argv, &error)) {
|
||||
if (g_strcmp0 (*argv, "--") == 0 && !seen_dash_dash) {
|
||||
/* This is for compatibility with older nmcli that required
|
||||
* options and properties to be separated with "--" */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue