simplify the error string logic

This commit is contained in:
Alex Flint 2021-05-09 14:01:08 -07:00
parent c9b504edc1
commit 7cc8da61cf
1 changed files with 0 additions and 3 deletions

View File

@ -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