Skip to content

fix: make -h an alias for --help on every command#48

Merged
jpage-godaddy merged 1 commit into
godaddy:mainfrom
dclayton-godaddy:fix/help-flag-alias
Jul 14, 2026
Merged

fix: make -h an alias for --help on every command#48
jpage-godaddy merged 1 commit into
godaddy:mainfrom
dclayton-godaddy:fix/help-flag-alias

Conversation

@dclayton-godaddy

Copy link
Copy Markdown
Contributor

Summary

  • clap's default help arg shows an abbreviated summary for -h but the full text for --help. Registers a global custom help arg (ArgAction::HelpLong) and disables the default in register_global_flags, so every cli-engine consumer gets identical -h/--help output across the root command and every subcommand for free — no per-app workaround needed.
  • This was previously worked around downstream in the godaddy-cli repo via with_register_flags; moving it here lets that workaround be dropped.

Test plan

  • cargo test --lib — new short_and_long_help_flags_render_identical_output test passes; only pre-existing unrelated failure (install_zsh_writes_script_and_rc, a sandbox path issue reproducible on clean main) remains
  • cargo clippy --all-targets -- -D warnings clean
  • cargo fmt clean
  • semgrep — 0 findings

clap's default help arg shows an abbreviated summary for -h and the
full help text for --help. Register a global custom help arg with
ArgAction::HelpLong instead and disable the default, so both flags
print identical output across the root command and every subcommand
for all cli-engine consumers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jpage-godaddy jpage-godaddy merged commit 9bd7f36 into godaddy:main Jul 14, 2026
2 checks passed
jpage-godaddy pushed a commit that referenced this pull request Jul 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.3](cli-engine-v0.4.2...cli-engine-v0.4.3)
(2026-07-14)


### Bug Fixes

* make -h an alias for --help on every command
([#48](#48))
([9bd7f36](9bd7f36))


### Miscellaneous

* add pull request template
([#46](#46))
([fe1600d](fe1600d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

4 participants