summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-11 03:27:49 -0500
committerJeff Carr <[email protected]>2025-09-11 03:27:49 -0500
commitd19f4a8911dc6b6baca272d6ee16b11eb6aea1a9 (patch)
tree71a62e85ff8657322410b36f82590801a9466127 /main.go
parent54811a5bc1906f5b20e9673621d54ffff9570392 (diff)
new forge init()
Diffstat (limited to 'main.go')
-rw-r--r--main.go21
1 files changed, 9 insertions, 12 deletions
diff --git a/main.go b/main.go
index 1c9d310..0ff1472 100644
--- a/main.go
+++ b/main.go
@@ -4,6 +4,7 @@ import (
"os"
"go.wit.com/dev/alexflint/arg"
+ "go.wit.com/lib/gui/prep"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
@@ -13,6 +14,8 @@ import (
var VERSION string
var BUILDTIME string
+var ARGNAME string = "go-clone"
+
var pp *arg.Parser
var forge *forgepb.Forge
@@ -20,20 +23,14 @@ var workingRepo *gitpb.Repo
func main() {
log.Info("go-clone version", VERSION, "built on", BUILDTIME)
- pp = arg.MustParse(&argv)
+ // command line parsing & handling
+ prep.Bash(ARGNAME, argv.DoAutoComplete) // todo: make this: prep.Bash(argv)
- // for very new users or users unfamilar with the command line, this may help them
- if argv.Repo == "help" || argv.Repo == "?" {
- pp.WriteHelp(os.Stdout)
- os.Exit(0)
- }
- if argv.Repo == "version" {
- log.Info(argv.Version())
- os.Exit(0)
- }
+ pp = arg.MustParse(&argv)
- // this package helps scan git repos
- forge = forgepb.Init()
+ // read in forge info
+ cfg := configInit()
+ forge = forgepb.InitFromConfig(cfg)
var err error
// attempt to clone, returns *gitpb.Repo