Improve suggestions - add explicit SuggestFor attribute

This commit is contained in:
Fabiano Franz
2015-09-25 12:04:28 -03:00
parent 3afa4db2c6
commit a83a172122
3 changed files with 29 additions and 6 deletions

View File

@ -82,9 +82,10 @@ var cmdDeprecated = &Command{
}
var cmdTimes = &Command{
Use: "times [# times] [string to echo]",
Short: "Echo anything to the screen more times",
Long: `a slightly useless command for testing.`,
Use: "times [# times] [string to echo]",
SuggestFor: []string{"counts"},
Short: "Echo anything to the screen more times",
Long: `a slightly useless command for testing.`,
PersistentPreRun: func(cmd *Command, args []string) {
timesPersPre = args
},
@ -827,6 +828,7 @@ func TestRootSuggestions(t *testing.T) {
"ri": "",
"timezone": "",
"foo": "",
"counts": "times",
}
for typo, suggestion := range tests {