parent
1a4c871bd8
commit
3636c19b38
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue