Show longer sibling routes in prefixed command help - #11098
Open
sandmor wants to merge 1 commit into
Open
Conversation
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
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.
Fixes #11007
omarchy hyprland monitor internal --help(and any bare invocation of arequired-args command) now ends with a "Related commands" section listing
siblings whose route extends the command's own:
Previously the sibling was only visible at group level
(
omarchy hyprland --help), so the sharedinternalprefix and identicalargument shape made
omarchy hyprland monitor internal toggleeasy to mistakefor a mirroring toggle.
How it works
bin/omarchy/show_related_commands: group-root commands keep theirwhole-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 onthe fast path, the router registers the resolved binary's filename
descendants (
omarchy-hyprland-monitor-internal-*) instead of only at groupdepth, so prefix siblings are known to the help renderer. This applies to
both the
--helpbranch and the bare required-args branch; plain dispatchstill pays no metadata cost.
test/cli: regressions cover the sibling listing via--help, via bareinvocation, and the absence of the section when a command has no longer
siblings.
docs/cli-router.md: documents the related-commands behavior.Verification
./test/clipasses.omarchy commands --checkpasses (452 commands).update perform), and the--jsonhelp path are unchanged.