diff options
| author | Jeff Carr <[email protected]> | 2025-10-25 19:33:20 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-25 19:33:20 -0500 |
| commit | 7f1b62bd9eb7f45551b6b41b9561425075e8e398 (patch) | |
| tree | 7ea29fbf53f158ddfd94153bfcda05e3e23694a5 | |
| parent | 521087b077765cabb52cfeec0ce7ebefa0c2c50d (diff) | |
more progress
| -rw-r--r-- | argv.Print.go | 6 | ||||
| -rw-r--r-- | theMagicOfAutocomplete.go | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/argv.Print.go b/argv.Print.go index 0d029b4..104fd18 100644 --- a/argv.Print.go +++ b/argv.Print.go @@ -86,5 +86,9 @@ func PrintStderr() { } func PrintStdout() { - fmt.Fprintf(os.Stdout, "%s\n", PB.Stdout) + line := strings.TrimSpace(PB.Stdout) + if line == "" { + // return + } + fmt.Fprintf(os.Stdout, "%s\n", line) } diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go index db8ad4a..3931f45 100644 --- a/theMagicOfAutocomplete.go +++ b/theMagicOfAutocomplete.go @@ -82,7 +82,6 @@ func Autocomplete(dest any) *Argv { // savePB() // me.pp = arg.MustParse(dest) me.Err = errors.Join(me.Err, me.mustParseFunc()) - me.debug = true fmt.Fprintf(Stderr, "did mustParseFunc(). heading to forge. err(%v)\n", me.Err) doStdoutStderr() return me.pb @@ -147,7 +146,6 @@ func prepareStdout() { } else { fmt.Fprintf(Stderr, "DID NOT RUN parseFlagsFunc() err(%v)\n", me.Err) } - me.debug = true if len(me.pb.Real) == 0 { // error is normal if there are no command line args @@ -160,7 +158,6 @@ func prepareStdout() { me.pb.HelpCounter = me.last.HelpCounter fmt.Fprintf(Stderr, "got to HelpCounter check err(%v)\n", me.Err) - doStdoutStderr() if me.pb.Fast { if me.last.Fast { @@ -189,7 +186,6 @@ func prepareStdout() { } } fmt.Fprintf(Stderr, "got to the end err(%v)\n", me.Err) - doStdoutStderr() return } @@ -203,7 +199,6 @@ func savePB() { } func doStdoutStderr() { - savePB() if me.debug { me.all.PrintHistory(me.last.GetCmd()) fmt.Fprintf(Stderr, "debug=true pb.Stdout (%v)\n", PB.Stdout) @@ -219,6 +214,7 @@ func doStdoutStderr() { } func saveAndExit() { + savePB() doStdoutStderr() os.Exit(0) } |
