tools/twiddle/cli/src/main/java/org/mobicents/tools/twiddle/jslee/ResourceCommand.java
@Override
	protected void processArguments(String[] args) throws CommandException {
		String sopts = ":bu:a:d:cr:plg";
		
		LongOpt[] lopts = { 
				new LongOpt("bind", LongOpt.NO_ARGUMENT, null, 'b'),
					//common options
					new LongOpt("link-name", LongOpt.REQUIRED_ARGUMENT, null, BindOperation.ra_link_name),
					new LongOpt("entity-name", LongOpt.REQUIRED_ARGUMENT, null, BindOperation.ra_entity_name),
				new LongOpt("unbind", LongOpt.REQUIRED_ARGUMENT, null, 'u'),
				new LongOpt("activate", LongOpt.REQUIRED_ARGUMENT, null, 'a'),
				new LongOpt("deactivate", LongOpt.REQUIRED_ARGUMENT, null, 'd'),
				new LongOpt("create", LongOpt.NO_ARGUMENT, null, 'c'),
					//entity-name is covered
					new LongOpt("ra-id", LongOpt.REQUIRED_ARGUMENT, null, CreateOperation.ra_id),
					new LongOpt("config", LongOpt.REQUIRED_ARGUMENT, null, CreateOperation.config),
				new LongOpt("remove", LongOpt.REQUIRED_ARGUMENT, null, 'r'),
				new LongOpt("update-config", LongOpt.NO_ARGUMENT, null, 'p'),
					//entity-name and config are already covered
				new LongOpt("list", LongOpt.NO_ARGUMENT, null, 'l'),
					new LongOpt("ra-entities", LongOpt.OPTIONAL_ARGUMENT, null, ListOperation.ra_entities),
					new LongOpt("ra-entities-in-state", LongOpt.REQUIRED_ARGUMENT, null, ListOperation.ra_entities_in_state),
					new LongOpt("ra-entities-by-link", LongOpt.REQUIRED_ARGUMENT, null, ListOperation.ra_entities_by_link),
					new LongOpt("links", LongOpt.OPTIONAL_ARGUMENT, null, ListOperation.links),
					new LongOpt("sbbs", LongOpt.REQUIRED_ARGUMENT, null, ListOperation.sbbs),
				new LongOpt("get", LongOpt.NO_ARGUMENT, null, 'g'),
					//ra-id is covered
					new LongOpt("state", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.state),
					new LongOpt("config-by-id", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.config_by_id),
					new LongOpt("config-by-name", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.config_by_name),
					//new LongOpt("usage-mbean", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.usage_mbean),
				 };


		Getopt getopt = new Getopt(null, args, sopts, lopts);
		// getopt.setOpterr(false);

		int code;
		while ((code = getopt.getopt()) != -1) {
			switch (code) {
			case ':':
				throw new CommandException("Option requires an argument: " + args[getopt.getOptind() - 1]);

			case '?':
				throw new CommandException("Invalid (or ambiguous) option: " + args[getopt.getOptind() - 1]);
				
			case 'b':
	
				super.operation = new BindOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;

				
			case 'u':
			
				super.operation = new UnBindOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;

		
			case 'a':

				super.operation = new ActivateOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
		
		
			case 'd':
				
				super.operation = new DeactivateOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
		
			case 'c':
				
				super.operation = new CreateOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
			case 'r':
				
				super.operation = new RemoveOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
	
			case 'p':
				
				super.operation = new UpdateConfigOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
		
			case 'l':
				
				super.operation = new ListOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
	
			case 'g':
				
				super.operation = new GetOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
	
			default:
				throw new CommandException("Command: \"" + getName() + "\", found unexpected opt: " + args[getopt.getOptind() - 1]);

			}
		}

	}
@Override
	protected void processArguments(String[] args) throws CommandException {
		String sopts = ":bu:a:d:cr:plg";
		
		LongOpt[] lopts = { 
				new LongOpt("bind", LongOpt.NO_ARGUMENT, null, 'b'),
					//common options
					new LongOpt("link-name", LongOpt.REQUIRED_ARGUMENT, null, BindOperation.ra_link_name),
					new LongOpt("entity-name", LongOpt.REQUIRED_ARGUMENT, null, BindOperation.ra_entity_name),
				new LongOpt("unbind", LongOpt.REQUIRED_ARGUMENT, null, 'u'),
				new LongOpt("activate", LongOpt.REQUIRED_ARGUMENT, null, 'a'),
				new LongOpt("deactivate", LongOpt.REQUIRED_ARGUMENT, null, 'd'),
				new LongOpt("create", LongOpt.NO_ARGUMENT, null, 'c'),
					//entity-name is covered
					new LongOpt("ra-id", LongOpt.REQUIRED_ARGUMENT, null, CreateOperation.ra_id),
					new LongOpt("config", LongOpt.REQUIRED_ARGUMENT, null, CreateOperation.config),
				new LongOpt("remove", LongOpt.REQUIRED_ARGUMENT, null, 'r'),
				new LongOpt("update-config", LongOpt.NO_ARGUMENT, null, 'p'),
					//entity-name and config are already covered
				new LongOpt("list", LongOpt.NO_ARGUMENT, null, 'l'),
					new LongOpt("ra-entities", LongOpt.OPTIONAL_ARGUMENT, null, ListOperation.ra_entities),
					new LongOpt("ra-entities-in-state", LongOpt.REQUIRED_ARGUMENT, null, ListOperation.ra_entities_in_state),
					new LongOpt("ra-entities-by-link", LongOpt.REQUIRED_ARGUMENT, null, ListOperation.ra_entities_by_link),
					new LongOpt("links", LongOpt.OPTIONAL_ARGUMENT, null, ListOperation.links),
					new LongOpt("sbbs", LongOpt.REQUIRED_ARGUMENT, null, ListOperation.sbbs),
				new LongOpt("get", LongOpt.NO_ARGUMENT, null, 'g'),
					//ra-id is covered
					new LongOpt("state", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.state),
					new LongOpt("config-by-id", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.config_by_id),
					new LongOpt("config-by-name", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.config_by_name),
					//new LongOpt("usage-mbean", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.usage_mbean),
				 };


		Getopt getopt = new Getopt(null, args, sopts, lopts);
		// getopt.setOpterr(false);

		int code;
		while ((code = getopt.getopt()) != -1) {
			switch (code) {
			case ':':
				throw new CommandException("Option requires an argument: " + args[getopt.getOptind() - 1]);

			case '?':
				throw new CommandException("Invalid (or ambiguous) option: " + args[getopt.getOptind() - 1]);
				
			case 'b':
	
				super.operation = new BindOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;

				
			case 'u':
			
				super.operation = new UnBindOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;

		
			case 'a':

				super.operation = new ActivateOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
		
		
			case 'd':
				
				super.operation = new DeactivateOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
		
			case 'c':
				
				super.operation = new CreateOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
			case 'r':
				
				super.operation = new RemoveOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
	
			case 'p':
				
				super.operation = new UpdateConfigOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
		
			case 'l':
				
				super.operation = new ListOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
	
			case 'g':
				
				super.operation = new GetOperation(super.context, super.log, this);
				super.operation.buildOperation(getopt, args);
				break;
	
			default:
				throw new CommandException("Command: \"" + getName() + "\", found unexpected opt: " + args[getopt.getOptind() - 1]);

			}
		}

	}
@ Override protected void processArguments ( String [ ] args ) throws CommandException { String sopts = ":bu:a:d:cr:plg" ; LongOpt [ ] lopts = { new LongOpt ( "bind" , LongOpt . NO_ARGUMENT , null , ' ' ) , //common options
 new LongOpt ( "link-name" , LongOpt . REQUIRED_ARGUMENT , null , BindOperation . ra_link_name ) , new LongOpt ( "entity-name" , LongOpt . REQUIRED_ARGUMENT , null , BindOperation . ra_entity_name ) , new LongOpt ( "unbind" , LongOpt . REQUIRED_ARGUMENT , null , ' ' ) , new LongOpt ( "activate" , LongOpt . REQUIRED_ARGUMENT , null , ' ' ) , new LongOpt ( "deactivate" , LongOpt . REQUIRED_ARGUMENT , null , ' ' ) , new LongOpt ( "create" , LongOpt . NO_ARGUMENT , null , ' ' ) , //entity-name is covered
 new LongOpt ( "ra-id" , LongOpt . REQUIRED_ARGUMENT , null , CreateOperation . ra_id ) , new LongOpt ( "config" , LongOpt . REQUIRED_ARGUMENT , null , CreateOperation . config ) , new LongOpt ( "remove" , LongOpt . REQUIRED_ARGUMENT , null , ' ' ) , new LongOpt ( "update-config" , LongOpt . NO_ARGUMENT , null , ' ' ) , //entity-name and config are already covered
 new LongOpt ( "list" , LongOpt . NO_ARGUMENT , null , ' ' ) , new LongOpt ( "ra-entities" , LongOpt . OPTIONAL_ARGUMENT , null , ListOperation . ra_entities ) , new LongOpt ( "ra-entities-in-state" , LongOpt . REQUIRED_ARGUMENT , null , ListOperation . ra_entities_in_state ) , new LongOpt ( "ra-entities-by-link" , LongOpt . REQUIRED_ARGUMENT , null , ListOperation . ra_entities_by_link ) , new LongOpt ( "links" , LongOpt . OPTIONAL_ARGUMENT , null , ListOperation . links ) , new LongOpt ( "sbbs" , LongOpt . REQUIRED_ARGUMENT , null , ListOperation . sbbs ) , new LongOpt ( "get" , LongOpt . NO_ARGUMENT , null , ' ' ) , //ra-id is covered
 new LongOpt ( "state" , LongOpt . REQUIRED_ARGUMENT , null , GetOperation . state ) , new LongOpt ( "config-by-id" , LongOpt . REQUIRED_ARGUMENT , null , GetOperation . config_by_id ) , new LongOpt ( "config-by-name" , LongOpt . REQUIRED_ARGUMENT , null , GetOperation . config_by_name ) , //new LongOpt("usage-mbean", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.usage_mbean),
 } ; Getopt getopt = new Getopt ( null , args , sopts , lopts ) ; // getopt.setOpterr(false);
 int code ; while ( ( code = getopt . getopt ( ) ) != - 1 ) { switch ( code ) { case ' ' : throw new CommandException ( "Option requires an argument: " + args [ getopt . getOptind ( ) - 1 ] ) ; case ' ' : throw new CommandException ( "Invalid (or ambiguous) option: " + args [ getopt . getOptind ( ) - 1 ] ) ; case ' ' : super . operation = new BindOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new UnBindOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new ActivateOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new DeactivateOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new CreateOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new RemoveOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new UpdateConfigOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new ListOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; case ' ' : super . operation = new GetOperation ( super . context , super . log , this ) ; super . operation . buildOperation ( getopt , args ) ; break ; default : throw new CommandException ( "Command: \"" + getName ( ) + "\", found unexpected opt: " + args [ getopt . getOptind ( ) - 1 ] ) ; } } }
/* (non-Javadoc)
@see org.mobicents.slee.tools.twiddle.AbstractSleeCommand#processArguments(java.lang.String[])
/ * ( non - Javadoc )