From 4320bb66a4fdeaab25af5bfcd5badf43b354f317 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 28 Oct 2025 21:33:20 -0500 Subject: this all needs to be redone --- complete.go | 10 +++++----- doBuild.go | 6 +++--- structs.go | 4 ++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/complete.go b/complete.go index 6f6478a..4abd80e 100644 --- a/complete.go +++ b/complete.go @@ -21,11 +21,6 @@ var BUILDTIME string // used for shell auto completion var APPNAME string = "wit" // todo: get this from $0 ? -func (args) MustParse() error { - me.pp = arg.MustParseArgv(&argv) - return nil -} - /* func (args) MustParse() error { me.pp = arg.MustParse(&argv) @@ -83,6 +78,11 @@ func (a args) DoAutoComplete() error { return err } +func (args) MustParse() error { + me.pp = arg.MustParseArgv(&argv) + return nil +} + func (args) Match() bool { base := []string{"build", "upgrade", "git", "publish", "pb", "linux", "droplet", "test"} base = append(base, "--version", "--force", "--all", "--dry-run", "--verbose") diff --git a/doBuild.go b/doBuild.go index 6bd70f8..2f8a1bd 100644 --- a/doBuild.go +++ b/doBuild.go @@ -24,7 +24,7 @@ func doBuild() (string, error) { // log.Info("doInstall() failed", err) argvpb.BadExit("doInstall() failed", err) } - if argv.DryRun { + if env.True("--dry-run") { argvpb.GoodExit("Nothing built --dry-run") } argvpb.GoodExit("EVERYTHING BUILT!") @@ -116,7 +116,7 @@ func doBuild() (string, error) { footer := cobol.SimpleTable(simpletable) log.Info("simple build table footer:", footer) - if argv.DryRun { + if env.True("--dry-run") { return "dryrun", nil } @@ -150,7 +150,7 @@ func doInstall(all *gitpb.Repos) error { footer := found.PrintForgedTable() log.Info("Starting 'go install' on these repos:", footer) - if argv.DryRun { + if env.True("--dry-run") { return nil } diff --git a/structs.go b/structs.go index aa71526..f67c80a 100644 --- a/structs.go +++ b/structs.go @@ -8,6 +8,7 @@ import ( "go.wit.com/dev/alexflint/arg" "go.wit.com/lib/debian" + "go.wit.com/lib/env" "go.wit.com/lib/fhelp" "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/forgepb" @@ -37,6 +38,9 @@ func initForge() { me.forge.RescanRepos() } initMachine() + if env.Verbose() { + env.PrintTable() + } } func initMachine() { -- cgit v1.2.3