Skip to content

List subcommands when --help follows an intermediate command prefix - #19473

Open
ThePrimeagen wants to merge 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/98b33bef-9dd0-4990-9d75-6ce03a3c134c
Open

ThePrimeagen wants to merge 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/98b33bef-9dd0-4990-9d75-6ce03a3c134c

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

In bin/omarchy, running omarchy theme bg --help prints Unknown Omarchy command and a Did you mean: omarchy theme ? suggestion instead of listing the theme bg subcommands, and that printed omarchy theme ? suggestion is itself refused with the same suggestion again.

Screenshots

Before After
before after

Reproduce

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

More cases

Printed ? suggestion loops on itself

Before After
before after

Another intermediate prefix is refused

Before After
before after

Related

Make the printed `omarchy <group> ?` suggestion work by
recognising a bare `?` as a help request alongside --help/-h
in remaining_has_help_flag, the $2 group-help checks in both
dispatch functions, and main. Strip --help/-h/? from the prefix
before show_prefix_help matches it against COMMAND_USAGE, so
intermediate prefixes such as `omarchy theme bg --help` and
`omarchy install gaming --help` list their subcommands instead
of falling through to Unknown, and the `?` suggestion no longer
loops on itself.
@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; no new actionable issues were found.

Summary

The CLI now lists subcommands when help follows an intermediate command prefix and accepts ? as help.

  • Intermediate command prefixes now show their matching help lists.

Reviews (2) · Last reviewed commit: "Avoid glob expansion in prefix help and ..." · Reviewed by Greptile

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

Copy link
Copy Markdown
Collaborator

I read the dispatcher diff, the existing review comments and the base branch’s contributor rules. I classify this as a bug fix, but the configured classification reviewer, deepseek-v4p1-flash, returned no class, so classification remains unsettled. No worker tests ran and no labels or code changed. This needs a completed second classification before verification can continue.

Reviewed by GPT-6 High in Codex; no second code review ran.

@omarchybot

Copy link
Copy Markdown
Collaborator

I read the dispatcher and test changes at bef9a976ddea2ba222e0aaf0a1d7ff1e9e9377b8, including the array-based prefix parsing and the added intermediate-prefix help regression cases. I classify this as a bug fix, but the configured classification reviewer, deepseek-v4p1-flash, again returned no class for this revision. Classification remains unsettled and needs a completed second classification before verification can continue. No worker tests ran, and no labels or code changed.

Reviewed by GPT-6 in Codex (reasoning effort not exposed to this session); this was the only code review in this run, and no second code review ran.

@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 makes a literal ? a help flag everywhere, including in remaining_has_help_flag, which scans every argument left after a resolved command. With that, omarchy notification send "Question" "?" prints help and sends nothing, where on quattro both words reach the command; that was the reason the ? handling was taken out of #18811 before the maintainer closed it. It also moves the flag stripping into show_prefix_help, which the fast path calls too, by splitting the joined string back into words.

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. Classification is unsettled: the two classifying models disagreed on whether this is a bug fix or an enhancement, so it carries no class label.

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.

2 participants