summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--complete.go16
-rw-r--r--parse.go7
2 files changed, 11 insertions, 12 deletions
diff --git a/complete.go b/complete.go
index 0fb29c9..aba6a33 100644
--- a/complete.go
+++ b/complete.go
@@ -40,16 +40,14 @@ func ParseFlagsArgv(dest ...interface{}) (*Parser, error) {
*/
return p, err
}
- if argvpb.PB.ErrCounter < 5 {
- if argvpb.Len() == 0 {
- // user didn't enter any text and is hitting <tab> after the command itself
- p.WriteHelp(argvpb.Stderr)
- if p.match != nil {
- // calls back to the application. this allows the application to provide autocomplete matches
- p.match()
- }
- return p, errors.New("WriteHelp() worked")
+ if argvpb.Len() == 0 {
+ // user didn't enter any text and is hitting <tab> after the command itself
+ p.WriteHelp(argvpb.Stderr)
+ if p.match != nil {
+ // calls back to the application. this allows the application to provide autocomplete matches
+ p.match()
}
+ return p, errors.New("WriteHelp() worked")
}
if argvpb.PB.GetCmd() == "" {
// user is trying to get help for a subcommand
diff --git a/parse.go b/parse.go
index bdeec1d..824603f 100644
--- a/parse.go
+++ b/parse.go
@@ -100,9 +100,10 @@ func Register(dest ...interface{}) {
// MustParse processes command line arguments and exits upon failure
func MustParseArgv(dest ...interface{}) *Parser {
register = append(register, dest...)
- if len(overrideFlags) == 0 {
- overrideFlags = append(overrideFlags, argvpb.Real()...)
- }
+ // if len(overrideFlags) == 0 {
+ // overrideFlags = append(overrideFlags, argvpb.Real()...)
+ // }
+ overrideFlags = argvpb.Real()
return mustParse(Config{Exit: mustParseExit, Out: mustParseOut}, register...)
}