Description
The --
prefix is extremely common in CLI options. When people communicate using markdown (e.g. in Slack or GitHub), it is possible that a --
gets rendered as some other kind of dash, like en-dash (–
) or em-dash (—
).
The current Jaro-Winkler similarity metric is great for most things, but the threshold is not crossed for very short options like --dev
. Therefore, someone trying –dev
(rendered from --dev
in markdown) will not see "Did you mean --dev
?" but just a generic error instead.
EDIT: scratch that. After debugging, it looks like the CommandParser
actually doesn't try to recognize this token as an option because of its first character. For the token –dev
, the splitOptionPrefix
function just considers the prefix to be ""
instead of the en dash (it only knows about -@/+
, which contains a real hyphen but not other types of dashes).
It would be nice to add a special case that compares options ignoring any kind of dash prefix.