summaryrefslogtreecommitdiff
path: root/argv.custom.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-19 05:08:00 -0500
committerJeff Carr <[email protected]>2025-10-19 05:08:00 -0500
commit2bbc498b02cbbe3ba68de391bffbe79ab0f226fc (patch)
tree3a09151aeb7a1294e83d61e847e74f9a982b837b /argv.custom.go
parentc78eff62bb86594f71f9ff43ff151820ae8e94d9 (diff)
new argvv0.0.125
Diffstat (limited to 'argv.custom.go')
-rw-r--r--argv.custom.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/argv.custom.go b/argv.custom.go
new file mode 100644
index 0000000..3504984
--- /dev/null
+++ b/argv.custom.go
@@ -0,0 +1,40 @@
+package main
+
+import (
+ "os"
+
+ "go.wit.com/lib/protobuf/argvpb"
+)
+
+// sent via -ldflags
+var VERSION string
+var BUILDTIME string
+
+// used for shell auto completion
+var APPNAME string = "go-mod-clean"
+
+func (a args) Description() string {
+ return `
+go-mod-clean will try to verify your go.* files are using the newest package versions
+
+* Recreate go.* with 'go mod init' and 'go mod tidy'
+* Set your required go in go.mod (default is go1.21
+* Check that the most recent master branch versions are used
+* Try to trim go.sum of non-existent entries
+`
+}
+
+/*
+ handles shell autocomplete
+*/
+
+// sends the strings to bash or zsh that will be your options
+func (a args) SendCompletionStrings(pb *argvpb.Argv) {
+ if pb.Cmd == "" {
+ base := []string{"strict", "--restore", "purge", "lax", "--version"}
+ pb.SendStrings(base)
+ } else {
+ pb.SubCommand(pb.Goargs...)
+ }
+ os.Exit(0)
+}