summaryrefslogtreecommitdiff
path: root/theMagicOfAutocomplete.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-18 06:37:00 -0500
committerJeff Carr <[email protected]>2025-10-18 06:37:00 -0500
commitb2c353f48082a1d581bee0b6ee71c93f58bff603 (patch)
tree1a77d472dda8d720b13e15f4ca39d8645396d5f3 /theMagicOfAutocomplete.go
parent8d1a704d6f41b5f08aabc276d1476266f51c5b63 (diff)
pass the flags to the go-arg parser
Diffstat (limited to 'theMagicOfAutocomplete.go')
-rw-r--r--theMagicOfAutocomplete.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go
index 8030feb..550b63d 100644
--- a/theMagicOfAutocomplete.go
+++ b/theMagicOfAutocomplete.go
@@ -130,10 +130,15 @@ func Autocomplete(dest any) *Argv {
// use go-args to parse the structs so we can use them here
// me.pp, err = arg.ParseFlags(flags, dest)
- if err := me.parseFlags(flags); err != nil {
+ if me.parseFlagsFunc == nil {
+ panic("argv.parseFlags() is nil")
+ }
+
+ if err := me.parseFlagsFunc(flags); err != nil {
log.Info("application parseFlags() err", err)
panic("argv.parseFlags() err")
}
+
if len(flags) == 0 {
// error is normal if there are no command line args
} else {