feat: add --version and --help flags - #6
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gloaming noticed
mdtaskhas 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 fighttrailing_var_arg/allow_hyphen_valuesjust 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/--versionprintsmdtask <version>;-h/--helpprints usage.mdtask <task> --helpstill forwards--helpto the task.CARGO_BIN_EXE_mdtask(zero test-harness deps), including one asserting the forwarding guarantee.No new dependencies. fmt + clippy clean.
🤖 Generated with Claude Code