Skip to content

Show longer sibling routes in prefixed command help - #11098

Open
sandmor wants to merge 1 commit into
omacom:quattrofrom
sandmor:t3code/fix-issue-11007
Open

Show longer sibling routes in prefixed command help#11098
sandmor wants to merge 1 commit into
omacom:quattrofrom
sandmor:t3code/fix-issue-11007

Conversation

@sandmor

@sandmor sandmor commented Sep 10, 2026

Copy link
Copy Markdown

Fixes #11007

omarchy hyprland monitor internal --help (and any bare invocation of a
required-args command) now ends with a "Related commands" section listing
siblings whose route extends the command's own:

Related commands:
  omarchy hyprland monitor internal mirror <on|off|toggle|recover>  Enable, disable, toggle, or recover mirroring the internal display to an external monitor

Previously the sibling was only visible at group level
(omarchy hyprland --help), so the shared internal prefix and identical
argument shape made omarchy hyprland monitor internal toggle easy to mistake
for a mirroring toggle.

How it works

  • bin/omarchy / show_related_commands: group-root commands keep their
    whole-group "Related commands" listing; named commands now fall through and
    list only siblings whose canonical route is a strict extension of their own
    route. Hidden commands stay hidden.
  • bin/omarchy / dispatch_fast_or_help: when command help is rendered on
    the fast path, the router registers the resolved binary's filename
    descendants (omarchy-hyprland-monitor-internal-*) instead of only at group
    depth, so prefix siblings are known to the help renderer. This applies to
    both the --help branch and the bare required-args branch; plain dispatch
    still pays no metadata cost.
  • test/cli: regressions cover the sibling listing via --help, via bare
    invocation, and the absence of the section when a command has no longer
    siblings.
  • docs/cli-router.md: documents the related-commands behavior.

Verification

  • ./test/cli passes.
  • omarchy commands --check passes (452 commands).
  • Group help, hidden-command suppression (update perform), and the --json
    help path are unchanged.

A named command's --help and bare required-args help now end with a
"Related commands" section listing siblings whose route extends its own
(e.g. `omarchy hyprland monitor internal mirror` under
`omarchy hyprland monitor internal`). All routes already appear only in
group help, which left the shared-prefix ambiguity undiscoverable from
the command itself.

Fixes omacom#11007
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.

CLI --help doesn't reveal sibling command with shared prefix (monitor internal vs monitor internal mirror)

1 participant