summaryrefslogtreecommitdiff
path: root/argv.go
diff options
context:
space:
mode:
Diffstat (limited to 'argv.go')
-rw-r--r--argv.go27
1 files changed, 20 insertions, 7 deletions
diff --git a/argv.go b/argv.go
index b3cab5c..a1d2862 100644
--- a/argv.go
+++ b/argv.go
@@ -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