Fix example/self

Fixes #34
This commit is contained in:
Eyal Posener 2017-05-23 07:33:38 +03:00
parent 1a4c871bd8
commit 3636c19b38
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ func main() {
// create the complete command // create the complete command
cmp := complete.New( cmp := complete.New(
"self", "self",
complete.Command{Flags: complete.Flags{"name": complete.PredictAnything}}, complete.Command{Flags: complete.Flags{"-name": complete.PredictAnything}},
) )
// AddFlags adds the completion flags to the program flags, // AddFlags adds the completion flags to the program flags,
@ -39,7 +39,7 @@ func main() {
// and ran as a completion script or handled a flag that passed // and ran as a completion script or handled a flag that passed
// as argument, the Run method will return true, // as argument, the Run method will return true,
// in that case, our program have nothing to do and should return. // in that case, our program have nothing to do and should return.
if cmp.Run() { if cmp.Complete() {
return return
} }