diff options
| author | Jeff Carr <[email protected]> | 2025-10-19 05:44:42 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-19 05:44:42 -0500 |
| commit | f730ed88ee48128da1d4f841fd43616621613f00 (patch) | |
| tree | a511cbe46e3a6ca13c240fc15a03baf90165f09a /argv.custom.go | |
| parent | 34015f3d4ee487efe329d0387458f609343c2f9f (diff) | |
new argv that somewhat works betterv0.2.87
Diffstat (limited to 'argv.custom.go')
| -rw-r--r-- | argv.custom.go | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/argv.custom.go b/argv.custom.go new file mode 100644 index 0000000..f49adcd --- /dev/null +++ b/argv.custom.go @@ -0,0 +1,50 @@ +package main + +import ( + "os" + + "go.wit.com/lib/protobuf/argvpb" + "go.wit.com/log" +) + +// sent via -ldflags +var VERSION string +var BUILDTIME string + +var APPNAME string = "virtigo" + +func (a args) Description() string { + return ` + virtigo: control your cluster + +This maintains a master list of all your vm's (aka 'droplets') +in your homelab cloud. You can import libvirt xml files. +This app talks to your hypervisors via the virtigod daemon. +` +} + +var INFO *log.LogFlag +var POLL *log.LogFlag +var WARN *log.LogFlag +var EVENT *log.LogFlag + +func init() { + full := "go.wit.com/apps/virtigo" + short := "virtigo" + + INFO = log.NewFlag("INFO", false, full, short, "general virtigo") + POLL = log.NewFlag("POLL", false, full, short, "virtigo polling") + WARN = log.NewFlag("WARN", true, full, short, "bad things") + EVENT = log.NewFlag("EVENT", true, full, short, "hypeprvisor/droplet events") +} + +// sends the strings to bash or zsh that will be your options +func (a args) SendCompletionStrings(pb *argvpb.Argv) { + if pb.Cmd == "" { + base := []string{"--version", "list", "droplet"} + pb.SendStrings(base) + } else { + pb.SubCommand(pb.Goargs...) + } + os.Exit(0) +} |
