Commit 27a9173d authored by keks's avatar keks

fix LongHelp for new commands that have old subcommands

parent 1ef4a052
...@@ -358,13 +358,19 @@ func subcommandText(cmd *cmds.Command, rootName string, path []string) []string ...@@ -358,13 +358,19 @@ func subcommandText(cmd *cmds.Command, rootName string, path []string) []string
for name := range cmd.Subcommands { for name := range cmd.Subcommands {
sortedNames = append(sortedNames, name) sortedNames = append(sortedNames, name)
} }
for name := range cmd.OldSubcommands {
sortedNames = append(sortedNames, name)
}
sort.Strings(sortedNames) sort.Strings(sortedNames)
subcmds := make([]*cmds.Command, len(cmd.Subcommands)) subcmds := make([]*cmds.Command, len(cmd.Subcommands) + len(cmd.OldSubcommands))
lines := make([]string, len(cmd.Subcommands)) lines := make([]string, len(cmd.Subcommands) + len(cmd.OldSubcommands))
for i, name := range sortedNames { for i, name := range sortedNames {
sub := cmd.Subcommands[name] sub := cmd.Subcommands[name]
if sub == nil {
sub = cmds.NewCommand(cmd.OldSubcommands[name])
}
usage := usageText(sub) usage := usageText(sub)
if len(usage) > 0 { if len(usage) > 0 {
usage = " " + usage usage = " " + usage
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment