Skip to content

Show help for nested command prefixes like theme bg - #19491

Open
ThePrimeagen wants to merge 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/eb9bda38-e7a6-4dbc-9672-f1630dad3db4
Open

ThePrimeagen wants to merge 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/eb9bda38-e7a6-4dbc-9672-f1630dad3db4

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

Typing omarchy theme bg --help in a terminal is refused by bin/omarchy as an unknown command suggesting omarchy theme ?, and running that suggestion loops back to itself, so the background help is never shown.

Screenshots

Before After
before after

Reproduce

  1. Press Super+Return to open a terminal.
  2. Type omarchy theme bg --help and press Return.
  3. Type omarchy theme ? and press Return.
  4. See Unknown Omarchy command: omarchy theme bg --help, Did you mean: omarchy theme ?, and exit 127, then the same refusal for omarchy theme ? itself, with no theme bg help.

More cases

Running the suggestion loops

Before After
before after

Other virtual prefixes with --help

Before After
before after

Unknown flag on a valid group

Before After
before after

Related

Strip `?` and flag-like arguments (in addition to --help/-h) when
building the prefix for show_prefix_help in dispatch_or_help, so
`omarchy theme ?` and `omarchy theme --all` resolve to the `theme`
prefix and show its commands with exit 0 instead of falling through
to Unknown with a tautological suggestion. Nested prefixes like
`theme bg --help` and `install ai --help` continue to show their
prefix help.
@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 help work for nested command prefixes and gives users runnable command suggestions.

  • Nested command prefixes now show their matching help.
  • Unknown commands now suggest runnable group help.

Both previous findings are fixed. Focused checks confirmed the reported help cases and unknown-command exit codes; Bash syntax checks passed.

Reviews (2) · Last reviewed commit: "Suggest runnable --help command and add ..." · Reviewed by Greptile

Comment thread bin/omarchy Resolved
Comment thread bin/omarchy Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 in Codex (effort setting not exposed) read the router diff, surrounding dispatch code, existing CLI tests, and the base branch’s command rules. I classified this as a bug fix, but the second classifier, deepseek-v4p1-flash, returned no usable class, so the classification is unsettled. No worker tests ran, and no code or labels changed. This is waiting for the classification to be settled before verification continues.

@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 in Codex (effort setting not exposed) reviewed the updated router, regression tests, and Greptile threads at 5e54220c0ece97a05c4921cffc35dea1e2fbd16a, against the base branch’s command rules. The new revision adds coverage for nested prefix help and runnable suggestions. The second classifier, deepseek-v4p1-flash, returned no usable class, so classification remains unsettled. No worker tests ran, and no code or labels changed. This is waiting for classification to be settled before verification continues.

@omarchybot

Copy link
Copy Markdown
Collaborator

The prefix help bug here is real: on quattro, omarchy theme bg lists its commands while omarchy theme bg --help exits 127, reproduced on an Omarchy ISO worker. Ten open pull requests fix it, and #19488 is the one being carried forward, because it changes prefix help and nothing else. It is verified on a worker and waiting on the maintainer.

What this one does beyond that fix: it removes every argument starting with - before the prefix lookup, so omarchy theme bg --anything lists the commands and exits 0 instead of reporting an unknown command. It changes the "Did you mean" line to end in --help, which is the one-line change #18811 was narrowed to before the maintainer closed it. It accepts ? as a help word, which #18811 also proposed. And it changes suggest_command to skip a candidate whose first word is what was typed, so omarchy theme bogus no longer gets theme suggested.

This pull request was read, not run. Reviewed by Claude Fable 5.2; the comparison of all ten diffs also went to Opus 5.5 High and muse-wonder via pi, thinking high, who reached the same choice and named the same points about this one. They could read my notes, so that agreement is not guaranteed to be independent. Nothing was pushed here. It is waiting on the maintainer, who decides whether to keep it open.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants