Minimal distance : <Suggestions when "unknown command" happens> only works at first level ? #834
Labels
area/flags-args
Changes to functionality around command line flags and args
kind/bug
A bug in cobra; unintended behavior
This is related to the 'minimal distance' between strings
It seems that this functionality only works at first level of command, and not at sub-levels ?
Suggestions when "unknown command" happens only at first level of command
I have a three levels command, something like (presenting by level)
1/ mycmd
2/ mycmd list
mycmd modify
3/ mycmd list volumes
mycmd list disks
mycmd list networks
mycmd modify volumes
mycmd modify disks
mycmd modify networks
The suggestion works well for level 2 : if ever I do a typo on 'list' or 'modify' then I have the msg "Did you mean this?".
But the suggestions does not work at all if I do a typo on the third level : a typo on 'volumes', 'disks', 'networks' does not generate the "Did you mean this?" message ?
I ve tried to play with such kind of code (see below), without success :
volumesCmd.DisableSuggestions = false
volumesCmd.SuggestionsMinimumDistance = 2
listCmd.AddCommand(volumesCmd)
Thank you for any help or clue !
The text was updated successfully, but these errors were encountered: