Skip to content

Commit

Permalink
param: also show unused params for 'param show -c'
Browse files Browse the repository at this point in the history
I find this generally useful for debugging.
  • Loading branch information
bkueng authored and dagar committed Jun 29, 2020
1 parent d22bbde commit 0c4fd2b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/systemcmds/param/param.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Change the airframe and make sure the airframe's default parameters are loaded:

PRINT_MODULE_USAGE_COMMAND_DESCR("show", "Show parameter values");
PRINT_MODULE_USAGE_PARAM_FLAG('a', "Show all parameters (not just used)", true);
PRINT_MODULE_USAGE_PARAM_FLAG('c', "Show only changed and used params", true);
PRINT_MODULE_USAGE_PARAM_FLAG('c', "Show only changed params (unused too)", true);
PRINT_MODULE_USAGE_PARAM_FLAG('q', "quiet mode, print only param value (name needs to be exact)", true);
PRINT_MODULE_USAGE_ARG("<filter>", "Filter by param name (wildcard at end allowed, eg. sys_*)", true);

Expand Down Expand Up @@ -457,7 +457,8 @@ static int
do_show(const char *search_string, bool only_changed)
{
PARAM_PRINT("Symbols: x = used, + = saved, * = unsaved\n");
param_foreach(do_show_print, (char *)search_string, only_changed, true);
// also show unused params if we show non-default values only
param_foreach(do_show_print, (char *)search_string, only_changed, !only_changed);
PARAM_PRINT("\n %u/%u parameters used.\n", param_count_used(), param_count());

return 0;
Expand Down

0 comments on commit 0c4fd2b

Please sign in to comment.