2017-05-05 10:01:27 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/posener/complete"
|
|
|
|
)
|
|
|
|
|
2017-05-05 10:06:31 -05:00
|
|
|
var (
|
|
|
|
build = complete.Command{
|
|
|
|
Flags: complete.Flags{
|
|
|
|
"-o": complete.FlagUnknownFollow,
|
|
|
|
"-i": complete.FlagNoFollow,
|
2017-05-05 10:01:27 -05:00
|
|
|
},
|
2017-05-05 10:06:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test = complete.Command{
|
|
|
|
Flags: complete.Flags{
|
|
|
|
"-run": complete.FlagUnknownFollow,
|
|
|
|
"-count": complete.FlagUnknownFollow,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
gogo = complete.Command{
|
|
|
|
Sub: complete.Commands{
|
|
|
|
"build": build,
|
|
|
|
"test": test,
|
2017-05-05 10:01:27 -05:00
|
|
|
},
|
2017-05-05 10:06:31 -05:00
|
|
|
Flags: complete.Flags{
|
|
|
|
"-h": complete.FlagNoFollow,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
2017-05-05 10:01:27 -05:00
|
|
|
|
|
|
|
func main() {
|
2017-05-05 10:06:31 -05:00
|
|
|
complete.New(gogo).Complete()
|
2017-05-05 10:01:27 -05:00
|
|
|
}
|