summaryrefslogtreecommitdiff
path: root/args.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-01 15:33:08 -0600
committerJeff Carr <[email protected]>2024-01-01 15:33:08 -0600
commitf03f76bc082a245f852dcd0cc52fef9ff48cdc93 (patch)
tree5e63087bc7cd1fe22743a4b60d120121ce0f7886 /args.go
initial commit
Diffstat (limited to 'args.go')
-rw-r--r--args.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/args.go b/args.go
new file mode 100644
index 0000000..7a9afd8
--- /dev/null
+++ b/args.go
@@ -0,0 +1,33 @@
+package digitalocean
+
+// initializes logging and command line options
+
+import (
+ arg "github.com/alexflint/go-arg"
+ log "go.wit.com/log"
+)
+
+var INFO log.LogFlag
+var POLL log.LogFlag
+var argDo ArgsDo
+
+// This struct can be used with the go-arg package
+type ArgsDo struct {
+ DigitalOceanTimer int `arg:"--digitalocean-poll-interval" help:"how often to poll droplet status (default 60 seconds)"`
+}
+
+func init() {
+ arg.Register(&argDo)
+
+ INFO.B = false
+ INFO.Name = "INFO"
+ INFO.Subsystem = "digitalocean"
+ INFO.Desc = "Enable log.Info()"
+ INFO.Register()
+
+ POLL.B = false
+ POLL.Name = "POLL"
+ POLL.Subsystem = "digitalocean"
+ POLL.Desc = "Show droplet status polling"
+ POLL.Register()
+}