Repository navigation
Conversation
`rig config get <key>` ignored the parent command's --with-source flag and printed only the value. Treat it like --show-source, on either side of `get`. --show-source, --json and plain `get` are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012FiU6MUdCBELKP3rxWkFTm
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Thanks, @markankamaransheogarat-sys, for your first PR here, and for your fix for #1618 with a test for the flag both before and after |
openrig-review
left a comment
There was a problem hiding this comment.
Approved at dc7e61d. rig config get <key> --with-source now prints the value with its source, the same single line as --show-source, whether the flag comes before or after get. --json still wins when combined, and plain get, --show-source and --json are unchanged. Required CI (8/8) passes here.
— dev60-planner@v-openrig-build
|
Thanks again, @markankamaransheogarat-sys, for a clean first PR. Merged as |
|
Thanks again, @markankamaransheogarat-sys: #1628 is released in 0.7.0 (release notes). |
…chwarz#1628) `rig config get <key> --with-source` printed only the value. `--with-source` is the parent `config` command's option, which Commander accepts on either side of `get`, but `get` never read it. It now reads it from the parent's options, as it already did for `--json`, and prints the same `value<TAB>(source: …)` line as `--show-source`, in both flag positions. `--json` is still checked first, so `--json --with-source` prints the JSON object as before. Plain `get`, `--show-source` and `--json` are unchanged. A new test drives the real command parsing in both positions.
What a user gets
Closes #1618. Before,
rig config get daemon.port --with-sourceprinted only the value. Now it prints the same single line as--show-source(7555 (source: file)), whether the flag comes beforeget(rig config --with-source get <key>) or after it (rig config get <key> --with-source).--with-sourceis the parent command's option, and commander accepts it in both positions, sogetnow reads it fromcmd.opts()next to its own--show-source.--show-source,--jsonand plaingetbehave exactly as before.--jsonstill wins when it is combined with--with-source.How you verified it
Tested at upstream
main27f0129dplus this change, on Linux with Node 22:packages/cli/test/config-get-with-source.test.ts(8 tests). For both flag positions it checks a value from the config file (source: file), one fromOPENRIG_PORT(source: env) and the default (source: default). It also checks that the line is identical to--show-source, and that plainget/--jsonare unchanged. Without the fix, 7 of the 8 fail; the one that passes is the "unchanged" test.npx tsc --noEmit -p packages/cli/tsconfig.json: clean.packages/clivitest: 5116 tests, 33 failures. Onmainwithout this change the same suite gives 5108 tests and the same 33 failures: I diffed the failing test names. They are environment-dependent on this machine (desktop-wake-loopandclient --versionneed a built CLI, plushost-ipv6-status,scope-*andpreflight).npm test/npm run lintacross all workspaces (onlydaemonwas built, as the cli tests need it).Anything you were unsure about
Whether
--with-sourceshould also be added togetas its own option for--help. I kept it on the parent, as the issue describes, so the help text stays the same.If this is security-related
Not security-related.
CHANGELOG.mdeditSummary by CodeRabbit
New Features
config getnow displays the resolved value and its source when--with-sourceis provided before or afterget.Bug Fixes
--jsonoutput and standardconfig getoutput remain unchanged.