diff options
| author | Jeff Carr <[email protected]> | 2025-09-11 03:27:49 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-11 03:27:49 -0500 |
| commit | d19f4a8911dc6b6baca272d6ee16b11eb6aea1a9 (patch) | |
| tree | 71a62e85ff8657322410b36f82590801a9466127 /main.go | |
| parent | 54811a5bc1906f5b20e9673621d54ffff9570392 (diff) | |
new forge init()
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -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 |
