public static void checkNumOfArgsNoMoreThan ( Command cmd , CommandLine cl , int n ) throws InvalidArgumentException { if ( cl . getArgs ( ) . length > n ) { throw new InvalidArgumentException ( ExceptionMessage . INVALID_ARGS_NUM_TOO_MANY . getMessage ( cmd . getCommandName ( ) , n , cl . getArgs ( ) . length ) ) ; } }
Checks the number of non - option arguments is no more than n for command .