public CommandLine addSubcommand(String name, Object command, String... aliases) {
        CommandLine subcommandLine = toCommandLine(command, factory);
        subcommandLine.getCommandSpec().aliases.addAll(Arrays.asList(aliases));
        getCommandSpec().addSubcommand(name, subcommandLine);
        CommandLine.Model.CommandReflection.initParentCommand(subcommandLine.getCommandSpec().userObject(), getCommandSpec().userObject());
        return this;
    }
public CommandLine addSubcommand ( String name , Object command , String ... aliases ) { CommandLine subcommandLine = toCommandLine ( command , factory ) ; subcommandLine . getCommandSpec ( ) . aliases . addAll ( Arrays . asList ( aliases ) ) ; getCommandSpec ( ) . addSubcommand ( name , subcommandLine ) ; CommandLine . Model . CommandReflection . initParentCommand ( subcommandLine . getCommandSpec ( ) . userObject ( ) , getCommandSpec ( ) . userObject ( ) ) ; return this ; }
Registers a subcommand with the specified name and all specified aliases. See also {@link #addSubcommand(String, Object)}.


@param name the string to recognize on the command line as a subcommand
@param command the object to initialize with command line arguments following the subcommand name.
This may be a {@code CommandLine} instance with its own (nested) subcommands
@param aliases zero or more alias names that are also recognized on the command line as this subcommand
@return this CommandLine object, to allow method chaining
@since 3.1
@see #addSubcommand(String, Object)