summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2021-05-09 14:01:08 -0700
committerAlex Flint <[email protected]>2021-05-09 14:01:08 -0700
commit7cc8da61cf3da353167fcc83ad4e751f3c82ec97 (patch)
tree41193f935d3242ff8d6d1480d1d78cc920c492ae
parentc9b504edc1b8da6b21564c1ebf5c1b49ed9ff431 (diff)
simplify the error string logic
-rw-r--r--usage.go3
1 files changed, 0 insertions, 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