summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-14 04:11:53 -0500
committerJeff Carr <[email protected]>2025-10-14 04:11:53 -0500
commit5d2788edbc203fdb3b99d073e507962cb0f0e6ac (patch)
tree73e46a23758882fe3cb929200f2211d096871ec7
parent660620c105f1a0a7d5e95ab6e2d4dc10113fd249 (diff)
killed erronous output on errorv0.0.36
-rw-r--r--theMagicOfAutocomplete.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go
index eadffb6..1eeedd1 100644
--- a/theMagicOfAutocomplete.go
+++ b/theMagicOfAutocomplete.go
@@ -6,6 +6,7 @@ package prep
import (
"errors"
"os"
+ "strings"
"time"
"go.wit.com/dev/alexflint/arg"
@@ -120,14 +121,22 @@ func Autocomplete(dest any) *Auto {
if s == "--autodebug" {
continue
}
+ if strings.TrimSpace(s) == "" {
+ // skip anything blank
+ continue
+ }
flags = append(flags, s)
}
// use go-args to parse the structs so we can use them here
myAuto.pp, err = arg.ParseFlags(flags, dest)
- if err != nil {
- // users has command line arguments that won't parse with go-args
- pb.Debugf("DEBUG: Parse error: %v flags(%v)", err, flags)
+ if len(flags) == 0 {
+ // error is normal if there are no command line args
+ } else {
+ if err != nil {
+ // users has command line arguments that won't parse with go-args
+ pb.Debugf("DEBUG: Parse error: %v flags%v", err, flags)
+ }
}
if myAuto.pp == nil {