summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
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