2024-10-11 13:55:13 -05:00
|
|
|
package main
|
|
|
|
|
2024-10-12 11:54:01 -05:00
|
|
|
import "go.wit.com/log"
|
|
|
|
|
2024-10-11 13:55:13 -05:00
|
|
|
/*
|
|
|
|
this parses the command line arguements
|
|
|
|
|
|
|
|
this enables command line options from other packages like 'gui' and 'log'
|
|
|
|
*/
|
|
|
|
|
2024-10-12 00:17:26 -05:00
|
|
|
var argv args
|
|
|
|
|
2024-10-11 13:55:13 -05:00
|
|
|
type args struct {
|
2024-10-12 10:59:11 -05:00
|
|
|
Hosts []string `arg:"--hosts" help:"hosts to connect to"`
|
|
|
|
Uptime bool `arg:"--uptime" default:"true" help:"allow uptime checks for things like Kuma"`
|
|
|
|
Port int `arg:"--port" default:"8080" help:"specify a different default port"`
|
2024-10-12 19:44:43 -05:00
|
|
|
Daemon bool `arg:"--daemon" help:"run in daemon mode"`
|
2024-10-11 13:55:13 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a args) Description() string {
|
|
|
|
return `
|
|
|
|
virtigo will help control your cluster of hypervisiors
|
|
|
|
|
2024-10-12 00:17:26 -05:00
|
|
|
go install go.wit.com/apps/virtigo@latest
|
2024-10-11 13:55:13 -05:00
|
|
|
`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (args) Version() string {
|
|
|
|
return "virtigo " + Version
|
|
|
|
}
|
2024-10-12 11:54:01 -05:00
|
|
|
|
|
|
|
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")
|
|
|
|
}
|