google / subcommands

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

Subcommand suggestions for typos #24

Open clconway opened 5 years ago

clconway commented 5 years ago

I'd like for Commander.Execute to print a suggestion if the given subcommand looks like a typo similar to what Git does:

$ git brunch
git: 'brunch' is not a git command. See 'git --help'.

The most similar command is
        branch

I have a simple implementation of this using https://github.com/agext/levenshtein that I will attach as a PR.