summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-01 00:56:59 -0600
committerJeff Carr <[email protected]>2024-01-01 00:56:59 -0600
commit1324717de0a1ccd830ca34aa03e0faa9e6d93a83 (patch)
tree5937a0856de459a6453eb534c8544dde5808ead1
parent0f4e3483331bc2504d330c07d86f79cb64416c88 (diff)
add log.Register(INFO) and go-arg support
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--digitalocean/args.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/digitalocean/args.go b/digitalocean/args.go
new file mode 100644
index 0000000..246f72d
--- /dev/null
+++ b/digitalocean/args.go
@@ -0,0 +1,27 @@
+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 argDo ArgsDo
+
+// This struct can be used with the go-arg package
+type ArgsDo struct {
+ DigitalOceanTimer bool `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()
+}