Open not-my-profile opened 1 year ago
Carrying some of the conversation from the PR
So this will only check for one-"word" swaps and only if the word separator is
-
(which it really should be) and won't handle typos within those swapped words.The thing I'm tying to decide if this is too narrow of a niche to include
@not-my-profile
Right ... if you want to I can convert the PR to a draft and we can discuss this in an issue.
Personally I think mixing up the order of words of CLI arguments happens much more often for me than misspelling them. E.g. ripgrep has
--type-not
... trying--not-type
instead is a very easy mistake to make but clap currently suggests--no-pre
. I think a small quality of life improvement like this across all clap CLIs would be nice ... sure this logic could be made more elaborate to also handle swaps in arguments consisting of e.g. 3 words but I think 2 word flags are much more common.
I want to sit on this to give this more thought. I'm trying to weigh out the couple of specific cases this helps with vs where the line is for us supporting these one-off heuristics.
While using the
deno
CLI (which uses clap) I experienced the following:The option I wanted was
--lock-write
.Another example would be ripgrep e.g.
rg --not-type
currently suggests--no-pre
when it should really be suggesting--type-not
.