diff options
| author | Jeff Carr <[email protected]> | 2024-10-30 02:28:53 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-30 02:28:53 -0500 |
| commit | 73b81913fa941504dfd2aa84fab9692b34fdcff6 (patch) | |
| tree | e63dcac97b103498428e0698f75f05eb9425f451 /argv.go | |
initial commitv0.0.1
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -0,0 +1,51 @@ +package main + +import "go.wit.com/log" + +/* + this parses the command line arguements + + this enables command line options from other packages like 'gui' and 'log' +*/ + +var argv args + +type args struct { + Xml []string `arg:"--libvirt" help:"import qemu xml files: --libvirt /etc/libvirt/qemu/*.xml"` + IgnoreCpu bool `arg:"--xml-ignore-cpu" default:"true" help:"ignore non-standard libvirt xml cpus"` + IgnoreBr bool `arg:"--xml-ignore-net" default:"true" help:"ignore network bridge name changes"` + IgnDisk bool `arg:"--xml-ignore-disk" default:"false" help:"ignore duplicate disk names"` + Port int `arg:"--port" default:"8080" help:"allow droplet events via http"` + Hosts []string `arg:"--hosts" help:"hosts to connect to"` +} + +// Save bool `arg:"--save" default:"false" help:"save protobuf config after import"` +// Start string `arg:"--start" help:"start a droplet"` +// Uptime bool `arg:"--uptime" default:"true" help:"allow uptime checks for things like Kuma"` + +func (a args) Description() string { + return ` + virtigoctl command line configure and control for virtigo +` +} + +func (args) Version() string { + return "virtigoctl " + Version +} + +var INFO *log.LogFlag +var POLL *log.LogFlag +var WARN *log.LogFlag +var SPEW *log.LogFlag +var EVENT *log.LogFlag + +func init() { + full := "go.wit.com/apps/virtigoctl" + short := "virtigoctl" + + 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") + SPEW = log.NewFlag("SPEW", true, full, short, "dump everything") + EVENT = log.NewFlag("EVENT", true, full, short, "hypeprvisor/droplet events") +} |
