From 7cc8da61cf3da353167fcc83ad4e751f3c82ec97 Mon Sep 17 00:00:00 2001 From: Alex Flint Date: Sun, 9 May 2021 14:01:08 -0700 Subject: [PATCH] simplify the error string logic --- usage.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/usage.go b/usage.go index e27ed5b..860dc15 100644 --- a/usage.go +++ b/usage.go @@ -310,9 +310,6 @@ func (p *Parser) lookupCommand(path ...string) (*command, error) { } } if found == nil { - if cmd.name == "" { - return nil, fmt.Errorf("%q is not a top-level subcommand", name) - } return nil, fmt.Errorf("%q is not a subcommand of %s", name, cmd.name) } cmd = found