Skip to content

fix(config): --config help advertised a filename the code never writes - #47

Merged
timimsms merged 1 commit into
mainfrom
fix/config-flag-filename
Aug 28, 2026
Merged

timimsms merged 1 commit into
mainfrom
fix/config-flag-filename

Conversation

@timimsms

Copy link
Copy Markdown
Owner

Summary

The --config flag help advertised $HOME/.config/cu/config.yml, but ConfigType is "yaml", so Save writes config.yaml. Cosmetic, but it is the documented path for a file users are told to edit by hand — and the two files are not interchangeable once one exists.

-      --config string   config file (default is $HOME/.config/cu/config.yml)
+      --config string   config file (default is $HOME/.config/cu/config.yaml)

Note on the diff size

One line of Go, 50 documentation pages. --config is a persistent root flag, so cobra renders it into every command's Global Flags block; regenerating with cu docs markdown updates all of them. Every doc diff is that single line plus the generator's datestamp — pages whose only change was the datestamp were reverted to keep the diff readable.

Checklist

  • ./scripts/ci.sh passes locally — except errcheck, which reports the same pre-existing findings on main, none in files this PR touches
  • Commit messages use conventional prefixes
  • CLI docs regenerated (cu docs markdown --dir docs/site/commands)
  • Docs updated if user-facing behavior changed

The flag help said $HOME/.config/cu/config.yml, but ConfigType is "yaml", so
Save writes config.yaml. Cosmetic, but it is the documented path for a file
users are told to edit by hand.

Regenerating the CLI docs touches every command page, since --config is a
global flag rendered into each one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aqbmccWm1tqttmBUCR5rv
ClickUp: 86dxbeqyt
@timimsms

Copy link
Copy Markdown
Owner Author

Review — approve, no blockers

Correct fix, and the diff-size explanation checks out. I verified the doc churn is exactly what's claimed — every changed line across all 50 pages collapses to two forms plus the datestamp:

$ git diff main...fix/config-flag-filename -- docs/ | grep '^[-+]' | sed 's/<datestamp>/DATE/' | sort | uniq -c
  50 +###### Auto generated by spf13/cobra on DATE
  50 +      --config string   config file (default is $HOME/.config/cu/config.yaml)
  50 -###### Auto generated by spf13/cobra on DATE
  50 -      --config string   config file (default is $HOME/.config/cu/config.yml)

No page carries an unrelated edit hiding in the noise.

I also regenerated the docs from the branch binary into a scratch directory and diffed against the committed tree with datestamps normalized — byte-identical, all 50 files. So trimming the datestamp-only pages didn't leave the committed docs out of sync with what the generator actually produces, which was the one thing worth checking about that decision. Nothing in CI verifies doc freshness either (the Test Documentation Build job only runs mkdocs), so there's no check to fall out of step with.

Worth saying the fix is more than cosmetic: the two filenames are not interchangeable once one exists, and config.yml would be silently ignored by a user who followed the old help text and hand-created it — a confusing failure with no error message.

@timimsms
timimsms merged commit a3c473b into main Aug 28, 2026
16 checks passed
@timimsms
timimsms deleted the fix/config-flag-filename branch August 28, 2026 08:34
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