Skip to content

feat(builtins): add --help and --version support to all tools#1230

Merged
chaliy merged 3 commits intomainfrom
claude/fix-jq-help-output-jMhhh
Apr 11, 2026
Merged

feat(builtins): add --help and --version support to all tools#1230
chaliy merged 3 commits intomainfrom
claude/fix-jq-help-output-jMhhh

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 11, 2026

Summary

  • Add check_help_version() helper in builtins/mod.rs that handles --help and --version long flags (short flags -h/-V excluded since they have different meanings in many tools like sort -V, ls -h, grep -h)
  • Add --help and --version support to ~80 builtin commands across all categories: text processing, file operations, path/system, data/archive, and pipeline tools
  • Special handling for jq (supports -h/-V directly since those are genuine help/version flags for jq)
  • Update specs/005-builtins.md documenting the standard flags convention

Test plan

  • Unit tests for check_help_version helper (5 cases: help, version, no version configured, stops at non-flag, no match)
  • Integration spec tests verifying --help/--version for representative tools (cat, grep, sort, ls, date)
  • Tests marked bash_diff since help output intentionally differs from real bash
  • All 2371 unit tests pass
  • All 15 spec test suites pass (1974 bash specs, 99.9% pass rate)
  • cargo fmt --check clean
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • Rebased on latest main

chaliy added 3 commits April 11, 2026 22:51
- Unit tests for check_help_version helper (5 cases: help, version, no
  version configured, stops at non-flag, no match)
- Integration spec tests verifying --help/--version for cat, grep, sort,
  ls, date
- Simplify du/df to use shared check_help_version helper
- Update specs/005-builtins.md documenting standard flags convention
Help output intentionally differs from real bash — mark tests with
bash_diff to exclude from bash comparison test suite.
@chaliy chaliy merged commit b99f4c5 into main Apr 11, 2026
27 checks passed
@chaliy chaliy deleted the claude/fix-jq-help-output-jMhhh branch April 11, 2026 23:20
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