summaryrefslogtreecommitdiff
path: root/argv.custom.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-19 05:32:06 -0500
committerJeff Carr <[email protected]>2025-10-19 05:32:06 -0500
commitae4d94942e53723785dc1df21c61235b713e964b (patch)
treeb79c3c030690e0cdbbab4f65483ef5ce4ccbf5ef /argv.custom.go
parentd7b8e423edae12489f8e341438ba61bb458dea9b (diff)
new argvv0.22.130
Diffstat (limited to 'argv.custom.go')
-rw-r--r--argv.custom.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/argv.custom.go b/argv.custom.go
new file mode 100644
index 0000000..91bab5b
--- /dev/null
+++ b/argv.custom.go
@@ -0,0 +1,25 @@
+package main
+
+import (
+ "os"
+
+ "go.wit.com/lib/protobuf/argvpb"
+)
+
+// are sent via -ldflags at buildtime
+var VERSION string
+var BUILDTIME string
+
+// used for shell auto completion
+var APPNAME string = "gowebd"
+
+// sends the strings to bash or zsh that will be your options
+func (a args) SendCompletionStrings(pb *argvpb.Argv) {
+ if pb.Cmd == "" {
+ base := []string{"test", "--version", "--force"}
+ pb.SendStrings(base)
+ } else {
+ pb.SubCommand(pb.Goargs...)
+ }
+ os.Exit(0)
+}