Skip to content

Suggest a runnable --help command for unknown commands and accept ? as help - #18811

Closed
ThePrimeagen wants to merge 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/08590dc7-f15e-4d12-822d-d4e34ed44458
Closed

ThePrimeagen wants to merge 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/08590dc7-f15e-4d12-822d-d4e34ed44458

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

Mistype an omarchy command and bin/omarchy suggests omarchy <group> ?. Running that suggestion fails the same way and suggests itself again, because nothing in bin/omarchy treats ? as a help flag.

Screenshots

Before After
before after

Reproduce

  1. Press Super+Enter to open a terminal.
  2. Type omarchy theme bogus --help and press Enter. It prints Did you mean: omarchy theme ?.
  3. Type that suggestion, omarchy theme ?, and press Enter. It prints Unknown Omarchy command: omarchy theme ? and suggests omarchy theme ? again, instead of listing the theme commands.

Related

bin/omarchy printed `Did you mean: omarchy <group> ?`, but no
dispatch path recognised `?`, so running the suggestion reported
the same command as unknown and suggested itself again. Treat `?`
like `--help`/`-h` in remaining_has_help_flag(), in the group-help
branches of dispatch_fast_or_help() and dispatch_or_help(), and in
the top-level and `commands` help cases, so `omarchy notification ?`
and `omarchy theme ?` list their group commands. Also change the
unknown-command suggestion to `omarchy <group> --help`, the
documented runnable form, so suggestions for unknown subcommands
and truncated words list the group commands.
@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Changes the unknown-command suggestion to omarchy <group> --help, so users get a command the router accepts.

  • Unknown-command suggestions open the matching command help.

Reviews (4) · Last reviewed commit: "Keep ? as plain input, change only the s..." · Reviewed by Greptile

Comment thread bin/omarchy Resolved
Add one check to test/cli that `omarchy notification ?` prints the
Notification commands listing. On the base branch it reports the
command as unknown and exits 127.

Co-authored-by: Cursor <cursoragent@cursor.com>
remaining_has_help_flag scans every leftover argument, so treating ? as a help flag made `omarchy notification send "Question" "?"` print help and send nothing, and an unquoted ? is a glob that expands to any one-character filename. The runnable --help suggestion is the fix; it needs no test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Pushed a476608, which narrows this PR to the one-line message fix. An unknown command now suggests Did you mean: omarchy theme --help instead of omarchy theme ?. The trailing ? looked like part of a command, and running it failed.

The four changes that made a bare ? a help flag are reverted. remaining_has_help_flag checks every leftover argument, so with those changes omarchy notification send "Question" "?" printed help and sent nothing. An unquoted ? is also a shell glob that matches any one-character filename in the current directory. The new test/cli assertion is dropped as well: it only tested the ? flag, and a string change needs no test under Omarchy's AGENTS.md. No test was kept.

Checked on an Omarchy ISO worker. The PR's previous head printed notification-send's usage for omarchy notification send "Question" "?", and this head passes both arguments through to send. omarchy them suggests omarchy theme --help, and that command prints the theme group help. omarchy <word> --help works for all 95 words suggest_command can return. ./test/cli passes (130 ok).

Codex Medium reviewed the commit and found nothing wrong. It confirmed the tree now matches quattro except for that one line, agreed no test is needed, and reported that every possible suggestion runs. The 95-target check above re-ran that last claim on the worker. Its independence is not guaranteed. This is ready for the maintainer.

@dhh

dhh commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

It's a question. I don't think this makes sense.

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.

3 participants