summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-07 08:58:24 -0600
committerJeff Carr <[email protected]>2025-02-07 08:58:24 -0600
commit9da0b6973450c082e1771d523c8b2becabf25862 (patch)
tree00dc6fb4730c8ef4f139ee79616afa8295297673 /main.go
parent8130ffd25b3a4b43eb1d0e43afeb6dd27064fa6a (diff)
add bash autocomplete
Diffstat (limited to 'main.go')
-rw-r--r--main.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/main.go b/main.go
index a85de75..a98fb38 100644
--- a/main.go
+++ b/main.go
@@ -14,7 +14,10 @@ import (
var VERSION string
var BUILDTIME string
-var golangVersion string = "1.21"
+// used for shell auto completion
+var ARGNAME string = "go-mod-clean"
+
+var golangVersion string = "1.22"
var pp *arg.Parser
var forge *forgepb.Forge
@@ -27,6 +30,14 @@ func main() {
log.Info("go-mod-clean version", VERSION, "built on", BUILDTIME)
pp = arg.MustParse(&argv)
+ if argv.Bash {
+ argv.doBash()
+ os.Exit(0)
+ }
+ if len(argv.BashAuto) != 0 {
+ argv.doBashAuto()
+ os.Exit(0)
+ }
// load the ~/.config/forge/ config
// this lets you configure repos you have read/write access too
forge = forgepb.InitPB() // todo: make this scan only if pb file not found