summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go21
1 files changed, 6 insertions, 15 deletions
diff --git a/main.go b/main.go
index 1fe56b7..51e4d33 100644
--- a/main.go
+++ b/main.go
@@ -5,6 +5,7 @@ import (
"strings"
"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"
@@ -25,25 +26,15 @@ var configSave bool
func main() {
var check *gitpb.Repo
- pp = arg.MustParse(&argv)
- if argv.Bash {
- argv.doBash()
- os.Exit(0)
- }
- if len(argv.BashAuto) != 0 {
- argv.doBashAuto()
- os.Exit(0)
- }
+ // command line parsing & handling
+ prep.Bash(ARGNAME, argv.DoAutoComplete) // todo: make this: prep.Bash(argv)
+ pp = arg.MustParse(&argv)
log.Info("go-mod-clean version", VERSION, "built on", BUILDTIME)
- // load the ~/.config/forge/ config
- cfg, err := configInit()
- if err != nil {
- log.Info("This tool requires your repos be scanned by forge first")
- badExit(nil, err)
- }
+ // read in forge info
+ cfg := configInit()
forge = forgepb.InitFromConfig(cfg)
// figure out what directory we are running in