public < A extends BaseArgument > ArgumentParser add ( A arg ) { if ( arg instanceof BaseOption ) { return add ( ( BaseOption ) arg ) ; } // No arguments can be added after a sub-command-set. if ( arguments . size ( ) > 0 && arguments . get ( arguments . size ( ) - 1 ) instanceof SubCommandSet ) { throw new IllegalArgumentException ( "No arguments can be added after a sub-command set" ) ; } arguments . add ( arg ) ; return this ; }
Add a sub - command .