Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/Cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ copy screen output to a file and save it.

Alternatively, use the `diff` command to dump only those settings that differ from their default values (those that have been changed).

Adding `showdefaults` to the Dump and Diff commands, e.g. `diff showdefaults`, will add a comment line showing the default value where it differs from the set value.

```
#default set fw_ff_pitch = 50
set fw_ff_pitch = 120
```

## Restore via CLI.

Expand Down
8 changes: 4 additions & 4 deletions src/main/fc/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static void dumpPgValue(const setting_t *value, uint8_t dumpMask)
{
char name[SETTING_MAX_NAME_LENGTH];
const char *format = "set %s = ";
const char *defaultFormat = "#set %s = ";
const char *defaultFormat = "#default set %s = ";
// During a dump, the PGs have been backed up to their "copy"
// regions and the actual values have been reset to its
// defaults. This means that settingGetValuePointer() will
Expand All @@ -556,10 +556,10 @@ static void dumpPgValue(const setting_t *value, uint8_t dumpMask)
if (dumpMask & SHOW_DEFAULTS && !equalsDefault) {
cliPrintf(defaultFormat, name);
// if the craftname has a leading space, then enclose the name in quotes
if (strcmp(name, "name") == 0 && ((const char *)valuePointer)[0] == ' ') {
cliPrintf("\"%s\"", (const char *)valuePointer);
if (strcmp(name, "name") == 0 && ((const char *)defaultValuePointer)[0] == ' ') {
cliPrintf("\"%s\"", (const char *)defaultValuePointer);
} else {
printValuePointer(value, valuePointer, 0);
printValuePointer(value, defaultValuePointer, 0);
}
cliPrintLinefeed();
}
Expand Down
Loading