blob: 00f8d7bf1d5a0eb49dd3f0c1fae5c2d0380ee053 (
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.GetCmd() == "" {
		// 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)
}
  |