blob: 1e8abac05cb3ccc7ed9f4b4b78074d285717a71d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package main
import (
"os"
"go.wit.com/lib/protobuf/argvpb"
)
// this is where to customize argv for your application
var APPNAME string = "basicwindow"
// sent via -ldflags
var VERSION string
var BUILDTIME string
func (a args) Description() string {
return `
This basicwindow example demonstrates multiple windows
`
}
// sends the strings to bash or zsh that will be your options
func (a args) SendCompletionStrings(pb *argvpb.Argv) {
if pb.Cmd == "" {
// these are base autocomplete strings
matches := []string{"--bash", "--version", "demo", "gui"}
pb.SendStrings(matches)
} else {
// autogenerate the strings for the subcommand using github.com/alexflint/go-arg
pb.GenerateSubCommandStrings(pb.Goargs...)
}
os.Exit(0)
}
|