@Override
	protected void processArguments(String[] args) throws CommandException {
		String sopts = ":lcrng";
		
		LongOpt[] lopts = { 
				new LongOpt("list", LongOpt.NO_ARGUMENT, null, 'l'),
					new LongOpt("table", LongOpt.OPTIONAL_ARGUMENT, null, ListOperation.table),
					new LongOpt("profile", LongOpt.REQUIRED_ARGUMENT, null, ListOperation.profile),
				new LongOpt("create", LongOpt.NO_ARGUMENT, null, 'c'),
					//those are also for remove
					new LongOpt("profile-name", LongOpt.REQUIRED_ARGUMENT, null, CreateOperation.profile_name),
					new LongOpt("table-name", LongOpt.REQUIRED_ARGUMENT, null, CreateOperation.table_name),
					new LongOpt("profile-spec", LongOpt.REQUIRED_ARGUMENT, null, CreateOperation.profile_spec),
				new LongOpt("remove", LongOpt.NO_ARGUMENT, null, 'r'),
					//covered above
				new LongOpt("rename", LongOpt.NO_ARGUMENT, null, 'n'),
					new LongOpt("current-name", LongOpt.REQUIRED_ARGUMENT, null, RenameOperation.current_name),
					new LongOpt("new-name", LongOpt.REQUIRED_ARGUMENT, null, RenameOperation.new_name),
				new LongOpt("get", LongOpt.NO_ARGUMENT, null, 'g'),
					//new LongOpt("profile-name", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.profile_name),
					new LongOpt("profile-spec", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.profile_spec),
					//new LongOpt("profile", LongOpt.REQUIRED_ARGUMENT, null, GetOperation.profile),
				};

		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 'l':

				super.operation = new ListOperation(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 'n':

				super.operation = new RenameOperation(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 = ":lcrng" ; LongOpt [ ] lopts = { new LongOpt ( "list" , LongOpt . NO_ARGUMENT , null , 'l' ) , new LongOpt ( "table" , LongOpt . OPTIONAL_ARGUMENT , null , ListOperation . table ) , new LongOpt ( "profile" , LongOpt . REQUIRED_ARGUMENT , null , ListOperation . profile ) , new LongOpt ( "create" , LongOpt . NO_ARGUMENT , null , 'c' ) , new LongOpt ( "profile-name" , LongOpt . REQUIRED_ARGUMENT , null , CreateOperation . profile_name ) , new LongOpt ( "table-name" , LongOpt . REQUIRED_ARGUMENT , null , CreateOperation . table_name ) , new LongOpt ( "profile-spec" , LongOpt . REQUIRED_ARGUMENT , null , CreateOperation . profile_spec ) , new LongOpt ( "remove" , LongOpt . NO_ARGUMENT , null , 'r' ) , new LongOpt ( "rename" , LongOpt . NO_ARGUMENT , null , 'n' ) , new LongOpt ( "current-name" , LongOpt . REQUIRED_ARGUMENT , null , RenameOperation . current_name ) , new LongOpt ( "new-name" , LongOpt . REQUIRED_ARGUMENT , null , RenameOperation . new_name ) , new LongOpt ( "get" , LongOpt . NO_ARGUMENT , null , 'g' ) , new LongOpt ( "profile-spec" , LongOpt . REQUIRED_ARGUMENT , null , GetOperation . profile_spec ) , } ; 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 'l' : super . operation = new ListOperation ( 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 'n' : super . operation = new RenameOperation ( 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 ] ) ; } } }
/* (non-Javadoc)
@see org.mobicents.slee.tools.twiddle.AbstractSleeCommand#processArguments(java.lang.String[])