Improve misspelled subcommand error message #8

Open
opened 2023-11-12 13:02:23 -07:00 by torque · 0 comments
Owner

Right now, if a subcommand is misspelled, the subcommand lookup will fail and the parser will return ParseError.ExtraValue which is

  1. the wrong error, and
  2. not helpful.

I don't think something like git's fuzzy match levenshtein distance technique to provide subcommand suggestions is necessary, but we should definitely detect this case and

  1. remark that the requested subcommand is unknown
  2. potentially provide the list of known subcommands with their abbreviated help

Obviously this error would only occur for a command that contains subcommands.

Right now, if a subcommand is misspelled, the subcommand lookup will fail and the parser will return `ParseError.ExtraValue` which is 1. the wrong error, and 2. not helpful. I don't think something like git's fuzzy match levenshtein distance technique to provide subcommand suggestions is necessary, but we should definitely detect this case and 1. remark that the requested subcommand is unknown 2. potentially provide the list of known subcommands with their abbreviated help Obviously this error would only occur for a command that contains subcommands.
torque added the
Kind/Bug
label 2023-11-12 13:02:40 -07:00
torque added this to the 0.1.0 milestone 2023-11-12 13:02:45 -07:00
torque self-assigned this 2023-11-12 13:02:47 -07:00
torque changed title from Improve typo subcommand error message to Improve misspelled subcommand error message 2023-11-12 16:47:42 -07:00
Sign in to join this conversation.
No description provided.