diff options
| author | Jeff Carr <[email protected]> | 2025-10-25 15:33:30 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-25 15:33:30 -0500 |
| commit | ebe85de161734b384802e2c85fc72854ce6aae9b (patch) | |
| tree | 629842e4872de4c3f8113ce45f77c3c0ce90d7ec | |
| parent | 418f790437ac264ede889604f31e6d81c7d35cd0 (diff) | |
jesus
| -rw-r--r-- | theMagicOfAutocomplete.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go index 13cf020..003a901 100644 --- a/theMagicOfAutocomplete.go +++ b/theMagicOfAutocomplete.go @@ -78,9 +78,11 @@ func Autocomplete(dest any) *Argv { if !me.isAuto { // not autocompleting. return to the application // save the pb & history - savePB() + // savePB() // me.pp = arg.MustParse(dest) me.Err = errors.Join(me.Err, me.mustParseFunc()) + me.debug = true + doStdoutStderr() return me.pb } @@ -136,6 +138,8 @@ func prepareStdout() { me.debug = true return } + me.debug = true + doStdoutStderr() if len(me.pb.Real) == 0 { // error is normal if there are no command line args @@ -196,7 +200,8 @@ func savePB() { errors.Join(me.Err, me.all.Save()) } -func saveAndExit() { +func doStdoutStderr() { + savePB() if me.debug { me.all.PrintHistory(me.last.GetCmd()) me.pb.PrintStderr() @@ -208,7 +213,10 @@ func saveAndExit() { } } me.pb.PrintStdout() - savePB() +} + +func saveAndExit() { + doStdoutStderr() os.Exit(0) } |
