Package gnu.getopt

Examples of gnu.getopt.LongOpt


    }

    private VersionArgs parseArgs(String[] args) {
        String shortOpts = "-:v";
        LongOpt[] longOpts = {
            new LongOpt("verbose", LongOpt.OPTIONAL_ARGUMENT, null, 'v')
        };
        Getopt getopt = new Getopt(getPromptCommandString(), args, shortOpts, longOpts);
        getopt.setOpterr(false);

        VersionArgs versionArgs = new VersionArgs();
View Full Code Here


        return "file";
    }

    public void parse(RecipeParser parser, RecipeContext context, String[] args) {
        String sopts = ":s:d:";
        LongOpt[] lopts = { new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
            new LongOpt("destination", LongOpt.REQUIRED_ARGUMENT, null, 'd') };

        String source = null;
        String destination = null;

        Getopt getopt = new Getopt(getName(), args, sopts, lopts);
View Full Code Here

        return "realize";
    }

    public void parse(RecipeParser parser, RecipeContext context, String[] args) {
        String sopts = ":f:";
        LongOpt[] lopts = { new LongOpt("file", LongOpt.REQUIRED_ARGUMENT, null, 'f') };

        String file = null;

        Getopt getopt = new Getopt(getName(), args, sopts, lopts);
        int code;
View Full Code Here

        return "deploy";
    }

    public void parse(RecipeParser parser, RecipeContext context, String[] args) {
        String sopts = ":f:d:";
        LongOpt[] lopts = { new LongOpt("file", LongOpt.REQUIRED_ARGUMENT, null, 'f'),
            new LongOpt("directory", LongOpt.REQUIRED_ARGUMENT, null, 'd') };

        String filename = null;
        String directory = null;

        Getopt getopt = new Getopt(getName(), args, sopts, lopts);
View Full Code Here

        return "configdef";
    }

    public void parse(RecipeParser parser, RecipeContext context, String[] args) {
        String sopts = ":n:d:";
        LongOpt[] lopts = { new LongOpt("default", LongOpt.REQUIRED_ARGUMENT, null, 'd'),
            new LongOpt("name", LongOpt.REQUIRED_ARGUMENT, null, 'n') };

        String replacementVariableName = null;
        String defaultValue = null;

        Getopt getopt = new Getopt(getName(), args, sopts, lopts);
View Full Code Here

        return "bundle";
    }

    public void parse(RecipeParser parser, RecipeContext context, String[] args) {
        String sopts = ":n:v:d:";
        LongOpt[] lopts = { new LongOpt("name", LongOpt.REQUIRED_ARGUMENT, null, 'n'),
            new LongOpt("version", LongOpt.REQUIRED_ARGUMENT, null, 'v'),
            new LongOpt("description", LongOpt.REQUIRED_ARGUMENT, null, 'd') };

        String name = null;
        String version = null;
        String description = null;
View Full Code Here

    }

    private void processJBossArgs(String currentWorkingDir, String args[]) {
        String programName = this.sysProps.getProperty("program.name", "jboss");
        String shortOpts = "-:b:c:D:P:";
        LongOpt longOpts[] = { new LongOpt("configuration", 1, null, 'c'), new LongOpt("properties", 1, null, 'P'),
            new LongOpt("host", 1, null, 'b'), };
        Getopt options = new Getopt(programName, args, shortOpts, longOpts);
        // Tell Getopt not to complain to stderr about unrecognized options...
        options.setOpterr(false);
        int c;
        while ((c = options.getopt()) != -1) {
View Full Code Here

    }

    private void processJBossArgs(String currentWorkingDir, String args[]) {
        String programName = this.sysProps.getProperty("program.name", "jboss");
        String shortOpts = "-:b:c:D:P:";
        LongOpt longOpts[] = { new LongOpt("configuration", 1, null, 'c'), new LongOpt("properties", 1, null, 'P'),
            new LongOpt("host", 1, null, 'b'), };
        Getopt options = new Getopt(programName, args, shortOpts, longOpts);
        // Tell Getopt not to complain to stderr about unrecognized options...
        options.setOpterr(false);
        int c;
        while ((c = options.getopt()) != -1) {
View Full Code Here

    public static void main(String[] args) throws Exception {
       
       
        LongOpt[] longOptions = new LongOpt[7];

        longOptions[0] = new LongOpt("driver-class", LongOpt.OPTIONAL_ARGUMENT, null, 'd');
        longOptions[1] = new LongOpt("dialect", LongOpt.OPTIONAL_ARGUMENT, null, 'i');
        longOptions[2] = new LongOpt("connection-url", LongOpt.REQUIRED_ARGUMENT, null, 'c');
        longOptions[3] = new LongOpt("username", LongOpt.OPTIONAL_ARGUMENT, null, 'u');
        longOptions[4] = new LongOpt("password", LongOpt.OPTIONAL_ARGUMENT, null, 'p');
        longOptions[5] = new LongOpt("jars", LongOpt.OPTIONAL_ARGUMENT, null, 'j');
        longOptions[6] = new LongOpt("persistence-unit", LongOpt.OPTIONAL_ARGUMENT, null, 's');

        Getopt options = new Getopt("iventory-serializer serializer", args, "d:i:c:u:p:j:s:", longOptions);

        String driverClass = "org.postgresql.Driver";
        String dialect = "org.hibernate.dialect.PostgreSQLDialect";
View Full Code Here

    private void processArguments(String args[])
    {
        int c;
       
        LongOpt[] longopts = new LongOpt[7];
        longopts[0] = new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h');
        longopts[1] = new LongOpt("nagios-base", LongOpt.REQUIRED_ARGUMENT, null, 'n');
        longopts[2] = new LongOpt("puller-class", LongOpt.REQUIRED_ARGUMENT, null, 'c');
        longopts[3] = new LongOpt("puller-param", LongOpt.REQUIRED_ARGUMENT, null, 'p');
        longopts[4] = new LongOpt("icons-url", LongOpt.REQUIRED_ARGUMENT, null, 'i');
        longopts[5] = new LongOpt("loggeduser", LongOpt.REQUIRED_ARGUMENT, null, 'u');
        longopts[6] = new LongOpt("loggedpass", LongOpt.REQUIRED_ARGUMENT, null, 'w');
       
        Getopt g = new Getopt("nexsm", args, "+:hn:c:p:i:u:w:", longopts);
        //g.setOpterr(false); // We'll do our own error handling
       
        while ((c = g.getopt()) != -1)
View Full Code Here

TOP

Related Classes of gnu.getopt.LongOpt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.