argbash icon indicating copy to clipboard operation
argbash copied to clipboard

Typo correction

Open matejak opened this issue 7 years ago • 2 comments

It would be nice to have support for typo detection/suggestion, so e.g. script --hepl would produce a --hepl is an invalid argument, did you mean --help? message

matejak avatar Aug 09 '17 20:08 matejak

Hello, have you considered using ARG_RESTRICT_VALUES as documented in https://argbash.readthedocs.io/en/latest/guide.html#convenience-macros? Regarding suggestions, that requires quite complex logic that would have to be implemented in Bash - one would need to "compute" the "distance" of the supplied string from existing options, and then suggesting to select existing one. If you have Bash code in mind that could do this, please go ahead and suggest that.

matejak avatar Oct 03 '22 22:10 matejak

I think ARG_RESTRICT_VALUES is probably what I want, by the documentation and examples don't sufficiently describe how the three options differ

gdevenyi avatar Oct 05 '22 22:10 gdevenyi