Don't crash if subcommand has no commands of its own
Don't crash if subcommand has no commands of its own

Adding a subcommand parser and then defining no commands on it can crash
estimatedCommands() since cmdnames is empty but the code assumes it is
at least one element long. This patch adds an explicit check for that.

Signed-off-by: Zygmunt Krynicki <06b40a82600060aa4dd63b8edab70ee2d86817cd@canonical.com>

fuchsia-mirror/third_party-github.com-jessevdk-go-flags,jessevdk/go-flags,fuchsia-mirror/third_party-github.com-jessevdk-go-flags,jessevdk/go-flags