summaryrefslogtreecommitdiff
path: root/clients/cli/nmcli.c
diff options
context:
space:
mode:
Diffstat (limited to 'clients/cli/nmcli.c')
-rw-r--r--clients/cli/nmcli.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c
index 76dda05096..ec23ff431b 100644
--- a/clients/cli/nmcli.c
+++ b/clients/cli/nmcli.c
@@ -184,6 +184,7 @@ usage (void)
g_printerr (_("Usage: nmcli [OPTIONS] OBJECT { COMMAND | help }\n"
"\n"
"OPTIONS\n"
+ " -o[verview] overview mode (hide default values)\n"
" -t[erse] terse output\n"
" -p[retty] pretty output\n"
" -m[ode] tabular|multiline output mode\n"
@@ -295,9 +296,10 @@ process_command_line (NmCli *nmc, int argc, char **argv)
break;
if (argc == 1 && nmc->complete) {
- nmc_complete_strings (argv[0], "--terse", "--pretty", "--mode", "--colors", "--escape",
- "--fields", "--nocheck", "--get-values",
- "--wait", "--version", "--help", NULL);
+ nmc_complete_strings (argv[0], "--terse", "--pretty", "--mode", "--overview",
+ "--colors", "--escape",
+ "--fields", "--nocheck", "--get-values",
+ "--wait", "--version", "--help", NULL);
}
if (argv[0][1] == '-' && argv[0][2] == '\0') {
@@ -306,7 +308,9 @@ process_command_line (NmCli *nmc, int argc, char **argv)
break;
}
- if (matches_arg (nmc, &argc, &argv, "-terse", NULL)) {
+ if (matches_arg (nmc, &argc, &argv, "-overview", NULL)) {
+ nmc->nmc_config_mutable.overview = TRUE;
+ } else if (matches_arg (nmc, &argc, &argv, "-terse", NULL)) {
if (nmc->nmc_config.print_output == NMC_PRINT_TERSE) {
g_string_printf (nmc->return_text, _("Error: Option '--terse' is specified the second time."));
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
@@ -415,6 +419,10 @@ process_command_line (NmCli *nmc, int argc, char **argv)
next_arg (nmc, &argc, &argv, NULL);
}
+ /* Ignore --overview when fields are set explicitly */
+ if (nmc->required_fields)
+ nmc->nmc_config_mutable.overview = FALSE;
+
/* Now run the requested command */
nmc_do_cmd (nmc, nmcli_cmds, *argv, argc, argv);