protected void _addOption(Option option){
		if(option==null){
			return;
		}

		if(this.usedOptions.contains(option.getOpt())){
			throw new IllegalArgumentException("ExecS Cli: short option <" + option.getOpt() + "> already in use");
		}
		if(this.usedOptions.contains(option.getLongOpt())){
			throw new IllegalArgumentException("ExecS Cli: long option <" + option.getLongOpt() + "> already in use");
		}
		this.options.addOption(option);
		if(option.getOpt()!=null){
			this.usedOptions.add(option.getOpt());
		}
		if(option.getLongOpt()!=null){
			this.usedOptions.add(option.getLongOpt());
		}
	}
protected void _addOption(Option option){
		if(option==null){
			return;
		}

		if(this.usedOptions.contains(option.getOpt())){
			throw new IllegalArgumentException("ExecS Cli: short option <" + option.getOpt() + "> already in use");
		}
		if(this.usedOptions.contains(option.getLongOpt())){
			throw new IllegalArgumentException("ExecS Cli: long option <" + option.getLongOpt() + "> already in use");
		}
		this.options.addOption(option);
		if(option.getOpt()!=null){
			this.usedOptions.add(option.getOpt());
		}
		if(option.getLongOpt()!=null){
			this.usedOptions.add(option.getLongOpt());
		}
	}
protected void _addOption ( Option option ) { if ( option == null ) { return ; } if ( this . usedOptions . contains ( option . getOpt ( ) ) ) { throw new IllegalArgumentException ( "ExecS Cli: short option <" + option . getOpt ( ) + "> already in use" ) ; } if ( this . usedOptions . contains ( option . getLongOpt ( ) ) ) { throw new IllegalArgumentException ( "ExecS Cli: long option <" + option . getLongOpt ( ) + "> already in use" ) ; } this . options . addOption ( option ) ; if ( option . getOpt ( ) != null ) { this . usedOptions . add ( option . getOpt ( ) ) ; } if ( option . getLongOpt ( ) != null ) { this . usedOptions . add ( option . getLongOpt ( ) ) ; } }
Adds a CLI option to the parser.
@param option new CLI option, ignored if the option is null or getOption() on the option is null
@throws IllegalArgumentException if short or long option was in use already
Adds a CLI option to the parser .