Skip to content

Subcommand --help registry + shared error helper (#89, #92)#118

Merged
JRS1986 merged 3 commits into
mainfrom
fix/subcommand-help-and-errors-style
May 25, 2026
Merged

Subcommand --help registry + shared error helper (#89, #92)#118
JRS1986 merged 3 commits into
mainfrom
fix/subcommand-help-and-errors-style

Conversation

@JRS1986
Copy link
Copy Markdown
Owner

@JRS1986 JRS1986 commented May 25, 2026

Summary

  • Adds cli_help.py registry mapping every subcommand path to a description, when-to-run line, and 1-3 worked examples. A post-pass in build_parser walks the subparser tree and applies it — coding-scaffold setup run --help (and every other subcommand) now has a real description and examples instead of bare argparse.
  • Adds errors.py with fail_with(cause, next_step, link=None) so every failure path prints the same three-line shape. New wiki page Errors-and-Recovery.md documents the style + recurring failure modes.
  • Hidden flat aliases (init, wizard, setup-tool, …) automatically inherit the canonical command's documentation.

Closes #89, closes #92.

Test plan

  • uv run pytest -q — 360 tests pass.
  • tests/test_subcommand_help.py asserts every visible subcommand has a non-empty description and example block.
  • python -m coding_scaffold setup run --help — shows description, when-to-run, examples, and the Glossary link.
  • Wiki page Errors-and-Recovery.md enumerates the recurring failure paths and the three-line format.

JRS1986 added 3 commits May 25, 2026 19:40
Closes #89, closes #92.

- Adds `cli_help.py` registry mapping each subcommand path -> description,
  examples, and when-to-run. A post-pass in `build_parser` walks the subparser
  tree and applies the registry, so every `<cmd> --help` now shows what the
  command does, when to run it, and 1-3 worked examples. Hidden flat aliases
  inherit the canonical command's documentation.
- Adds `errors.py` with `fail_with(cause, next_step, link=None)` and a matching
  `CliError` exception. The format is three lines: cause / next / see. Wiki
  `Errors-and-Recovery.md` documents the style and the recurring failure modes
  (no AGENTS.md, missing tool, untouched .env, eval-on-empty-repo, manifest
  version mismatch).
- Tests assert every visible subcommand has a non-empty description and at
  least one example block, every registry entry has examples, and the error
  helper preserves the three-line shape.
…nd-errors-style

# Conflicts:
#	docs/docs/wiki/_meta.json
#	src/coding_scaffold/cli.py
@JRS1986 JRS1986 merged commit bf21372 into main May 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant