Skip to content

Show prefix help when --help follows a command prefix - #19488

Open
ThePrimeagen wants to merge 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/38bbdeef-ad09-4677-9b87-9fdf2877d00c
Open

ThePrimeagen wants to merge 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/38bbdeef-ad09-4677-9b87-9fdf2877d00c

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

Running omarchy theme bg --help should list the bg subcommands, but bin/omarchy prints Unknown Omarchy command: omarchy theme bg --help and exits 127.

Screenshots

Before After
before after

Reproduce

  1. Press Super+Enter to open a terminal.
  2. Type omarchy theme bg --help and press Enter.
  3. See Unknown Omarchy command: omarchy theme bg --help, Did you mean: omarchy theme ?, and exit:127, instead of the theme bg commands: list.

More cases

omarchy theme bg -h

Before After
before after

Related

In dispatch_or_help, `omarchy theme bg --help` passed the full
`omarchy theme bg --help` string to show_prefix_help, which never
matches a command usage prefix, so it fell through to Unknown
command. Strip a trailing --help/-h from the args used for the
prefix lookup so a prefix such as `theme bg` lists its subcommands
with or without the help flag, while the Unknown error still
reports the original args.
@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

The PR makes trailing --help and -h show subcommands for an unfinished command prefix.

  • Nested command prefixes show their command list when followed by a help flag.

No new issues found in the changes since the previous review.

Reviews (2) · Last reviewed commit: "Add CLI regression tests for prefix --he..." · Reviewed by Greptile

Comment thread bin/omarchy Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 High in Codex read the router change, surrounding help dispatch, existing CLI tests, and Greptile’s review. I classified this as a bug fix, but the configured second classifier, deepseek-v4p1-flash, returned no usable classification, so the two-model classification is incomplete. The separate review service health check passed.

No worker tests ran and no code or labels changed. This is waiting on classification before verification can continue.

@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 High in Codex read the new regression tests in 313b4cf, covering prefix help with both --help and -h, along with the router and surrounding help dispatch. I classified this head as a bug fix; the configured second classifier, deepseek-v4p1-flash, again returned no usable classification, so classification remains incomplete.

No worker tests ran, and no code or labels changed. This is waiting on a completed classification before verification can continue.

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Nov 20, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Fable 5.2, with a second opinion from Opus 5.5 High and muse-wonder via pi, thinking high. The bug is real and this fixes it: on quattro at b20d787, omarchy theme bg lists the commands under it while omarchy theme bg --help and -h print "Unknown Omarchy command" and exit 127. The same holds for hw asus, hyprland workspace layout, setup security and install service. At this head (313b4cf) all five list their commands and exit 0.

Run on an Omarchy ISO worker: ./test/cli passes at this head (137 ok), on this head merged into current quattro (139 ok), and with #16944 merged on top as well (147 ok); the two change different parts of dispatch_or_help and merge without conflict in either order. With bin/omarchy put back to the merge base the suite stops at the new theme bg --help line with exit 127, so the test fails without the fix. Unchanged, as checked on the worker: omarchy theme bogus --help, omarchy them and omarchy bogus --help still exit 127 with the same message, and agent account --help, plugin install --help and theme --help print what they did before. Hidden commands stay out of the listing because it still goes through show_prefix_help.

The change strips one trailing --help or -h, the same shape the router already accepts after a flags-only parent such as omarchy agent account --help. omarchy theme bg --help --json and omarchy theme bg -- --help still exit 127 as they do on quattro; nothing here makes them worse and neither has a defined answer for a prefix, so I left that alone. Both reviewers found no defect and agreed on that point; they could read my worker output, so their agreement is not guaranteed to be independent.

Nine other open pull requests address the same symptom (#19448, #19450, #19456, #19460, #19473, #19487, #19489, #19491, #19495). This is the one carried forward because it is the only one that changes prefix help and nothing else: the others also change the "Did you mean" line, which was declined in #18811, or accept ? as a help flag, or change what an unknown command exits with. Nothing was pushed here. It is waiting on the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants