summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-19 04:48:28 -0500
committerJeff Carr <[email protected]>2025-10-19 04:48:28 -0500
commit867b8dce9ea8f9f22718313691664f1f0e97e4c8 (patch)
treed2d45fffa8e106475a09b766b6bf316aff92d56e /main.go
parent2896bf0b1d58b27b331ea437c7c5a7d7318c8e43 (diff)
new argv
Diffstat (limited to 'main.go')
-rw-r--r--main.go27
1 files changed, 8 insertions, 19 deletions
diff --git a/main.go b/main.go
index 8e60ad0..0884d10 100644
--- a/main.go
+++ b/main.go
@@ -9,25 +9,14 @@ import (
"go.wit.com/log"
)
-// argv *argvpb.Argv // more experiments for bash handling
-// me.argv = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args
-
-// sent via -ldflags
-var VERSION string
-var BUILDTIME string
-
-var ARGNAME string = "go-clone"
-
-var forge *forgepb.Forge
-var newargv *argvpb.Argv // more experiments for bash handling
-
var workingRepo *gitpb.Repo
func main() {
- newargv = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args
+ me = new(mainType)
+ me.argv = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args
var err error
- forge, err = forgepb.Init()
+ me.forge, err = forgepb.Init()
if err != nil {
log.Info("This tool requires forge")
badExit(err)
@@ -55,7 +44,7 @@ func main() {
if workingRepo.GetRepoType() == "binary" || workingRepo.GetRepoType() == "plugin" {
log.Info("build will probably fail", workingRepo.GetGoPath(), "is", workingRepo.GetRepoType())
}
- if err := forge.Build(workingRepo, nil); err != nil {
+ if err := me.forge.Build(workingRepo, nil); err != nil {
log.Warn("BUILD FAILED", workingRepo.GetGoPath(), err)
badExit(err)
}
@@ -66,7 +55,7 @@ func main() {
if workingRepo.GetRepoType() == "binary" || workingRepo.GetRepoType() == "plugin" {
log.Info("install will probably fail", workingRepo.GetGoPath(), "is", workingRepo.GetRepoType())
}
- if err := forge.Install(workingRepo, nil); err != nil {
+ if err := me.forge.Install(workingRepo, nil); err != nil {
log.Warn("INSTALL FAILED", workingRepo.GetGoPath(), err)
badExit(err)
}
@@ -85,12 +74,12 @@ func okExit(thing string) {
log.Info(thing, "ok")
}
log.Info("Finished clone on", workingRepo.GetGoPath(), "ok")
- forge.ConfigSave()
+ me.forge.ConfigSave()
os.Exit(0)
}
func badExit(err error) {
- log.Info("Total repositories:", forge.Repos.Len())
- log.Info("Finished go-clone with error", err, forge.Config.ReposDir)
+ log.Info("Total repositories:", me.forge.Repos.Len())
+ log.Info("Finished go-clone with error", err, me.forge.Config.ReposDir)
os.Exit(-1)
}