public Args parse(String [] arguments) throws InvalidParameterException{
        Args args = new Args();
        if(arguments == null || arguments.length <= 0){
            throw new InvalidParameterException("arguments is empty");
        }
        if(arguments.length < 2){
            throw new InvalidParameterException("miss required arguments");
        }
        if(commands.contains(arguments[0].toLowerCase())){
            args.setCommand(arguments[0]);
        }else{
            throw new InvalidParameterException("Unknown command "+arguments[0]);
        }
        if(JavaClassNameParser.isInvalidClassName(arguments[1])){
            args.setTargetName(arguments[1]);
        }else{
            throw new InvalidParameterException(String.format("The targetName %s is not a valid class name!",arguments[1]));
        }
        if(arguments.length >= 3){
            if(arguments[2].startsWith("-")){
                parseOptions(arguments[2].substring(1),args);
            }else{
                parseTemplateGroup(arguments[2],args);
            }
        }
        if(arguments.length >= 4){
            parseTemplateGroup(arguments[3],args);
        }
        if(arguments.length >= 5){
            parseConfigFileName(arguments[4],args);
        }

        return args;
    }