Skip to content

CLI "showdefaults" fix - #11781

Open
breadoven wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
breadoven:abo_cli_showdefaults_fix
Open

CLI "showdefaults" fix#11781
breadoven wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
breadoven:abo_cli_showdefaults_fix

Conversation

@breadoven

Copy link
Copy Markdown
Collaborator

Fixes use of CLI "showdefaults" Diff/Dump command option so that actual default values are shown rather than the set value. "default" has also been added to the default setting line to make it clear that's what it is.

@qodo-code-review

Copy link
Copy Markdown
Contributor

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fix CLI showdefaults to print true defaults and clarify output format

🐞 Bug fix 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Fix showdefaults to print the actual default value (not the current set value).
• Prefix default comment lines with #default for clearer dump/diff output.
• Document showdefaults behavior and example output in CLI guide.
Diagram

graph TD
  A["CLI diff/dump (showdefaults)"] --> B["dumpPgValue()"] --> C{"SHOW_DEFAULTS && changed?"}
  C -- "yes" --> D["Print '#default set ...'"] --> E[/"CLI output"/]
  C -- "no/after" --> F["Print 'set ...'"] --> E
  B --- G[("Settings PG values")]

  subgraph Legend
    direction LR
    _cmd["Command"] ~~~ _fn["Function"] ~~~ _dec{"Decision"} ~~~ _out[/"Output"/] ~~~ _data[("Data")]
  end
Loading
High-Level Assessment

The PR’s approach is the correct minimal fix: showdefaults should print from the default-value pointer (settingGetValuePointer) rather than the current/copy pointer. The added #default prefix improves readability without changing command semantics. Alternatives like adding a new dump mode or restructuring pointer naming would add complexity without benefit for this bug.

Files changed (2) +10 / -4

Bug fix (1) +4 / -4
cli.cFix 'showdefaults' to print default pointer value and add '#default' prefix +4/-4

Fix 'showdefaults' to print default pointer value and add '#default' prefix

• Updates the default comment line format from '#set ...' to '#default set ...' for clarity. Fixes 'showdefaults' output to print the actual default value (including quoted craft name handling) by using 'defaultValuePointer' instead of 'valuePointer'.

src/main/fc/cli.c

Documentation (1) +6 / -0
Cli.mdDocument 'showdefaults' output semantics with example +6/-0

Document 'showdefaults' output semantics with example

• Adds guidance explaining that 'showdefaults' on 'dump'/'diff' emits a comment line showing the default value when it differs from the current value. Includes an example illustrating the new '#default set ...' line preceding the 'set ...' line.

docs/Cli.md

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@github-actions

Copy link
Copy Markdown

Test firmware build ready — commit 1370405

Download firmware for PR #11781

244 targets built. Find your board's .hex file by name on that page (e.g. MATEKF405SE.hex). Files are individually downloadable — no GitHub login required.

Development build for testing only. Use Full Chip Erase when flashing.

@breadoven breadoven added this to the 10.0 milestone Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant