From 4c6ddf93724e51d8af914671bfd1090f42ce09a6 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 22 Mar 2015 23:16:22 -0700 Subject: [PATCH] Param command: Add functionality to view active params --- src/systemcmds/param/param.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/systemcmds/param/param.c b/src/systemcmds/param/param.c index 36a00c0f0b..6b855cf582 100644 --- a/src/systemcmds/param/param.c +++ b/src/systemcmds/param/param.c @@ -235,8 +235,9 @@ do_import(const char *param_file_name) static void do_show(const char *search_string) { - printf(" + = saved, * = unsaved\n"); + printf("Symbols: x = used, + = saved, * = unsaved\n"); param_foreach(do_show_print, (char *)search_string, false, false); + printf("\n %u parameters total, %u used.\n", param_count(), param_count_used()); exit(0); } @@ -278,12 +279,12 @@ do_show_print(void *arg, param_t param) } /* the search string must have been consumed */ - if (!(*ss == '\0' || *ss == '*')) { + if (!(*ss == '\0' || *ss == '*') || *pp != '\0') { return; } } - printf("%c %s: ", + printf("%c %c %s: ", (param_used(param) ? 'x' : ' '), param_value_unsaved(param) ? '*' : (param_value_is_default(param) ? ' ' : '+'), param_name(param));