[BUG]: Incorrect order of similar subcommands in error message #373

Closed
opened 2026-01-05 14:50:07 +01:00 by adam · 1 comment
Owner

Originally created by @flacial on GitHub (May 12, 2024).

Describe the bug
When a subcommand is misspelled or not recognized, the tip message displays a list of similar subcommands. But the order of these subcommands is not right. The most relevant subcommand should be listed first, followed by the next most relevant, and so on.

To Reproduce
Steps to reproduce the behavior:

  1. Open the command prompt
  2. Run the command komorebic send-to-mon
  3. Notice the tip message

Expected behavior
The error message should display the list of similar subcommands in the correct order, with the most relevant subcommand listed first. In this case, the expected order should be:

  1. send-to-monitor
  2. send-to-monitor-workspace
  3. send-to-named-workspace
  4. send-to-workspace
  5. cycle-send-to-monitor

Screenshots and Videos
Here is the output of the error message:

C:\Users\flacial>komorebic send-to-mon
error: unrecognized subcommand 'send-to-mon'

  tip: some similar subcommands exist: 'cycle-send-to-monitor', 'send-to-workspace', 'send-to-named-workspace', 'send-to-monitor-workspace', 'send-to-monitor'

Operating System

OS Name:                   Windows 11 Pro
OS Version:                22631.3527 v23H2

komorebic check Output

No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\flacc

Looking for configuration files in C:\Users\flacial

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\flacial\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
Originally created by @flacial on GitHub (May 12, 2024). **Describe the bug** When a subcommand is misspelled or not recognized, the `tip` message displays a list of similar subcommands. But the order of these subcommands is not right. The most relevant subcommand should be listed first, followed by the next most relevant, and so on. **To Reproduce** Steps to reproduce the behavior: 1. Open the command prompt 2. Run the command `komorebic send-to-mon` 3. Notice the `tip` message **Expected behavior** The error message should display the list of similar subcommands in the correct order, with the most relevant subcommand listed first. In this case, the expected order should be: 1. `send-to-monitor` 2. `send-to-monitor-workspace` 3. `send-to-named-workspace` 4. `send-to-workspace` 5. `cycle-send-to-monitor` **Screenshots and Videos** Here is the output of the error message: ```shell C:\Users\flacial>komorebic send-to-mon error: unrecognized subcommand 'send-to-mon' tip: some similar subcommands exist: 'cycle-send-to-monitor', 'send-to-workspace', 'send-to-named-workspace', 'send-to-monitor-workspace', 'send-to-monitor' ``` **Operating System** ``` OS Name: Windows 11 Pro OS Version: 22631.3527 v23H2 ``` **`komorebic check` Output** ``` No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\flacc Looking for configuration files in C:\Users\flacial Found komorebi.json; this file can be passed to the start command with the --config flag Found C:\Users\flacial\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag ```
adam closed this issue 2026-01-05 14:50:07 +01:00
Author
Owner

@LGUG2Z commented on GitHub (May 12, 2024):

Imo this is not a komorebi bug. If you feel strongly about this please file an issue on the Clap repo: https://github.com/clap-rs/clap

@LGUG2Z commented on GitHub (May 12, 2024): Imo this is not a komorebi bug. If you feel strongly about this please file an issue on the Clap repo: https://github.com/clap-rs/clap
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#373