google / subcommands

Go subcommand library.
Apache License 2.0
749 stars 48 forks source link

Adds subcommand suggestions for apparent typos. #26

Open clconway opened 5 years ago

clconway commented 5 years ago

This adds a dependency on github.com/agext/levenshtein to compute the edit distance from the given subcommand to the program's registered subcommand names.

Fixes #24

clconway commented 5 years ago

@adjackura Ping?

adjackura commented 5 years ago

Sorry for not setting this earlier. I'd prefer not to add dependencies to this package as it is critical for a number of systems and just adding in typo help doesn't seem like a big enough reason to change that right now.

fgm commented 3 years ago

One thing which could be done to support the use case without adding dependencies is support a generic catchall handler, as suggested in #30 : that way anyone wishing to add a levenshtein (or whatever) approximate matcher could add it on its own without having to fork this package.