Skip to content

feat: add --version and --help flags - #6

Merged
jhheider merged 2 commits into
mainfrom
feat/version-help-flags
Jul 21, 2026
Merged

feat: add --version and --help flags#6
jhheider merged 2 commits into
mainfrom
feat/version-help-flags

Conversation

@jhheider

Copy link
Copy Markdown
Owner

gloaming noticed mdtask has no --version (and that the arg parser is hand-rolled).

Call: add the flags to the hand-rolled parser, not a real arg-parser. mdtask is a task runner: everything after the task name is forwarded verbatim to the task (like just/make/npm run). A real parser (clap or a lighter one) wants to own --flags, so you'd fight trailing_var_arg/allow_hyphen_values just to restore the forwarding the current code has for free. Given that, the tiny surface (list/run/lint/mcp/-f), and the deliberate no-parser design, a parser is all cost.

  • -V/--version prints mdtask <version>; -h/--help prints usage.
  • Recognised only in the first (subcommand) position, so mdtask <task> --help still forwards --help to the task.
  • CLI smoke tests via CARGO_BIN_EXE_mdtask (zero test-harness deps), including one asserting the forwarding guarantee.

No new dependencies. fmt + clippy clean.

🤖 Generated with Claude Code

jhheider and others added 2 commits July 21, 2026 01:58
gloaming noticed mdtask had no --version. Added -V/--version and -h/--help
to the hand-rolled parser rather than pulling in an arg-parser dependency:
mdtask is a task runner, so everything after the task name is forwarded to
the task verbatim (like just/make). A real parser would fight to claim
those flags. So version/help are recognised only in the first (subcommand)
position, keeping `mdtask <task> --help` forwarding intact.

CLI smoke tests via CARGO_BIN_EXE_mdtask (no test-harness dep), including
one that pins the forwarding guarantee.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VR4FWfzRhNYTv6VPGR1M1W
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VR4FWfzRhNYTv6VPGR1M1W
@jhheider
jhheider merged commit fae2f38 into main Jul 21, 2026
6 checks passed
@jhheider
jhheider deleted the feat/version-help-flags branch July 21, 2026 06:04
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