Skip to content

fix(cli): keep every positional argument; show plain-text help descriptions - #25

Merged
Snider merged 2 commits into
mainfrom
fix/cli-positional-args-help
Nov 19, 2026
Merged

Snider merged 2 commits into
mainfrom
fix/cli-positional-args-help

Conversation

@Snider

@Snider Snider commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Two bugs found while building GrootDPS's terminal commands on core.Cli.

1. Positional arguments overwrote each other. Cli.Run set every non-flag argument to the same _arg key, so only the last survived (export 1234 fight.json → _arg = "fight.json", the 1234 gone).

  • _args now holds every positional in order; read it with the new Options.Args().
  • _arg is the first positional. Every estate caller (agent, cli, go-build, go-crypt, go-scm, …) reads _arg as "the argument", so single-argument commands are unchanged.
  • docs/commands.md already said "repeated _arg options"; the docs now describe the real shape.

2. Help never showed a hand-written Description. PrintHelp treated it as an i18n key, found no translation, and printed only the path. An untranslated Description now shows as written. A translator still wins, and path-derived keys still print the path alone.

Tests: TestOptions_Args_{Good,Bad,Ugly}, ExampleOptions_Args, TestCli_Cli_PrintHelpDescription_{Good,Ugly}, TestCli_Cli_RunPositionals_Good. go test, go vet and gofmt are clean.

Estate check: agent and cli pass their tests against this branch, through a temporary go.work in a scratch directory (not committed anywhere). The exceptions are 6 agent QA/dispatch tests, which fail the same way without this change under any go.work, because GOWORK leaks into the repos those tests spawn.

core/go is written under review: not merged, waiting for Snider.

🤖 Generated with Claude Code
Co-Authored-By: Virgil virgil@lethean.io

…ptions

Cli.Run wrote each positional to the same "_arg" key, so only the last one
survived: `export 1234 fight.json` lost the 1234. Positionals now keep their
order in "_args" (read with the new Options.Args), and "_arg" is the first,
which is what every single-argument caller in the estate already expects.
docs/commands.md already promised repeated arguments; the code now matches.

PrintHelp treated a hand-written Description as an i18n key, found no
translation and printed the bare path. An untranslated Description now shows
as written; a translator still wins, and path-derived keys still print the
path alone.

Checked against the heaviest "_arg" users: agent and cli tests pass with this
core (agent's 6 QA/dispatch tests fail under any go.work, with or without the
change, because GOWORK leaks into the repos they spawn).

Co-Authored-By: Virgil <virgil@lethean.io>
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…he AX-7 guard

The naming guard matches Test<File>_<Type>_<Method>_<Variant>; the short
names left Options_Args counted as untested. The guard is back to main's
baseline (29 gaps, none from this branch).

Co-Authored-By: Virgil <virgil@lethean.io>
@Snider
Snider merged commit 375f20a into main Nov 19, 2026
1 check failed
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