summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2017-03-24 14:36:12 +0100
committerLubomir Rintel <lkundrak@v3.sk>2017-03-28 15:32:06 +0200
commitcd2a5c5800cb01e88270229577c26e339c37de72 (patch)
tree1f4060ee56d29584a007a65c8958bbc7ba067e34
parentf909ef421bbfdeba4619490aa99bd22dba734ddc (diff)
downloadNetworkManager-cd2a5c5800cb01e88270229577c26e339c37de72.tar.gz
cli/connections: drop the redundant parsing of --show-secretslr/cli-ask-rh1351263
This is no longer needed now that --show-secrets is a global option.
-rw-r--r--clients/cli/connections.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 26b5e57776..2c7e96954f 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -1746,25 +1746,19 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
char *profile_flds = NULL, *active_flds = NULL;
GPtrArray *invisibles, *sorted_cons;
gboolean active_only = FALSE;
- gboolean show_secrets = FALSE;
GArray *order = NULL;
int i;
- /* check connection show options [--active] [--show-secrets] */
- for (i = 0; i < 3; i++) {
+ /* check connection show options [--active] */
+ while (argc) {
if (argc == 1 && nmc->complete) {
- nmc_complete_strings (*argv, "--active", "--show-secrets",
+ nmc_complete_strings (*argv, "--active",
"--order", NULL);
}
if (!active_only && nmc_arg_is_option (*argv, "active")) {
active_only = TRUE;
next_arg (nmc, &argc, &argv);
- } else if (!show_secrets && nmc_arg_is_option (*argv, "show-secrets")) {
- /* --show-secrets is deprecated in favour of global --show-secrets */
- /* Keep it here for backwards compatibility */
- show_secrets = TRUE;
- next_arg (nmc, &argc, &argv);
} else if (!order && nmc_arg_is_option (*argv, "order")) {
if (!argc) {
g_set_error_literal (&err, NMCLI_ERROR, 0,
@@ -1782,7 +1776,6 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
break;
}
}
- show_secrets = nmc->show_secrets || show_secrets;
if (argc == 0) {
const GPtrArray *connections;
@@ -1912,9 +1905,9 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
if (without_fields || profile_flds) {
if (con) {
nmc->required_fields = profile_flds;
- if (show_secrets)
+ if (nmc->show_secrets)
update_secrets_in_connection (NM_REMOTE_CONNECTION (con), con);
- res = nmc_connection_profile_details (con, nmc, show_secrets);
+ res = nmc_connection_profile_details (con, nmc, nmc->show_secrets);
nmc->required_fields = NULL;
if (!res)
goto finish;