diff options
| author | Jeff Carr <[email protected]> | 2025-04-11 21:01:18 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-04-11 21:01:18 -0500 |
| commit | 16558e1b72762e47ca9664c74922e060d571cea4 (patch) | |
| tree | ceab312d2b1290e8691fafd755510b1bf32aef4f /argv.go | |
| parent | 1fd6b1d36d099a3301b62293d004e26bea83a070 (diff) | |
autocomplete + doList()
Diffstat (limited to 'argv.go')
| -rw-r--r-- | argv.go | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -11,12 +11,25 @@ import "go.wit.com/log" var argv args type args struct { - Verbose bool `arg:"--verbose" help:"talk more"` - Config string `arg:"env:VIRTIGO_HOME" help:"defaults to ~/.config/virtigo/"` - Port int `arg:"--port" default:"8080" help:"allow droplet events via http"` - Server string `arg:"env:VIRTIGO_SERVER" help:"what virtigo cluster to connect to"` - Xml []string `arg:"--libvirt" help:"import qemu xml files: --libvirt /etc/libvirt/qemu/*.xml"` - Admin bool `arg:"--admin" help:"enter admin mode"` + List *ListCmd `arg:"subcommand:list" help:"list things"` + Config string `arg:"env:VIRTIGO_HOME" help:"defaults to ~/.config/virtigo/"` + Server string `arg:"env:VIRTIGO_SERVER" help:"what virtigo cluster to connect to"` + Verbose bool `arg:"--verbose" help:"talk more"` + Port int `arg:"--port" default:"8080" help:"allow droplet events via http"` + Xml []string `arg:"--libvirt" help:"import qemu xml files: --libvirt /etc/libvirt/qemu/*.xml"` + Admin bool `arg:"--admin" help:"enter admin mode"` + Bash bool `arg:"--bash" help:"generate bash completion"` + BashAuto []string `arg:"--auto-complete" help:"todo: move this to go-arg"` +} + +type EmptyCmd struct { +} + +type testCmd string + +type ListCmd struct { + Droplets *EmptyCmd `arg:"subcommand:droplets" help:"list droplets"` + Hypervisors *EmptyCmd `arg:"subcommand:hypervisors" help:"list hypervisors"` } func (a args) Description() string { @@ -30,7 +43,7 @@ This app talks to your hypervisors via the virtigod daemon. } func (args) Version() string { - return "virtigo " + Version + return ARGNAME + " " + VERSION + " Built on " + BUILDTIME } var INFO *log.LogFlag |
