Skip to content

-no-rc flag missing from -h usage output #72

@peczenyj

Description

@peczenyj

The -no-rc flag (added with the layered config feature, #69) is documented in README.md and AGENTS.md but does not appear in the CLI -h output.

This is because -no-rc is parsed by the early-scan path (internal/app/app.go:scanEarlyFlags) — the same mechanism that handles the retro-theme egg flags (-cga, -green, -amber). Those flags are intentionally hidden, but -no-rc is a normal, user-facing configuration flag and should be discoverable.

Current -h (excerpt):

  -version
        print version and exit
  -width int
        column width per side for -diff=side (0 = auto from terminal)

README.md:162 already lists it:

-version        print version and exit
-no-rc          skip loading .structalignrc files

Two reasonable options:

  1. Register -no-rc with the regular flag.FlagSet alongside the other flags; remove its handling from scanEarlyFlags. It doesn't need to be early-scanned the way the egg theme flags do — RC loading happens after flag parsing today only for the egg flags' sake. (Needs a small refactor in app.Run to honor the parsed value before loadRCFiles.)
  2. Add a manual "Other flags:" section to the usage text that documents -no-rc (and optionally the retro-theme eggs) without registering them with flag.FlagSet.

Option 1 is cleaner — -no-rc isn't really an easter egg. Worth checking whether anything relies on it being strippable before flag.Parse (e.g., the -- separator handling in scanEarlyFlags).

Doc-only nit: this is the first divergence between -h and the README flag block, so fixing it preserves the "README mirrors -h" invariant.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions