Add suggestions support
The new option `app.Suggest` enables command and flag suggestions via the jaro-winkler distance algorithm. Flags are scoped to their appropriate commands whereas command suggestions are scoped to the current command level. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
This commit is contained in:
@@ -34,6 +34,7 @@ cli v2 manual
|
||||
* [Version Flag](#version-flag)
|
||||
+ [Customization](#customization-2)
|
||||
* [Timestamp Flag](#timestamp-flag)
|
||||
* [Suggestions](#suggestions)
|
||||
* [Full API Example](#full-api-example)
|
||||
|
||||
<!-- tocstop -->
|
||||
@@ -1426,6 +1427,13 @@ In this example the flag could be used like this :
|
||||
|
||||
Side note: quotes may be necessary around the date depending on your layout (if you have spaces for instance)
|
||||
|
||||
### Suggestions
|
||||
|
||||
To enable flag and command suggestions, set `app.Suggest = true`. If the suggest
|
||||
feature is enabled, then the help output of the corresponding command will
|
||||
provide an appropriate suggestion for the provided flag or subcommand if
|
||||
available.
|
||||
|
||||
### Full API Example
|
||||
|
||||
**Notice**: This is a contrived (functioning) example meant strictly for API
|
||||
|
Reference in New Issue
Block a user