public SubCommandSet add ( SubCommand < SubCommandDef > subCommand ) { if ( subCommandMap . containsKey ( subCommand . getName ( ) ) ) { throw new IllegalArgumentException ( "SubCommand with name " + subCommand . getName ( ) + " already exists" ) ; } this . subCommands . add ( subCommand ) ; this . subCommandMap . put ( subCommand . getName ( ) , subCommand ) ; for ( String alias : subCommand . getAliases ( ) ) { if ( subCommandMap . containsKey ( alias ) ) { throw new IllegalArgumentException ( "SubCommand (" + subCommand . getName ( ) + ") alias " + alias + " already exists" ) ; } this . subCommandMap . put ( alias , subCommand ) ; } return this ; }
Add a sub - command to the sub - command - set .