Package gnu.getopt

Examples of gnu.getopt.LongOpt


   private String parseArguments(String[] args)
   {
      String shortOpts = "hwko:r:s:c:qtl";
      LongOpt[] longOpts =
      {
         new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
         new LongOpt("wsdl", LongOpt.NO_ARGUMENT, null, 'w'),
         new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
         new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
         new LongOpt("resource", LongOpt.REQUIRED_ARGUMENT, null, 'r'),
         new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
         new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
         new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
         new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
         new LongOpt("load-provider", LongOpt.NO_ARGUMENT, null, 'l'),
      };
     
      Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
      int c;
      while ((c = getopt.getopt()) != -1)
View Full Code Here


        LOG.info(usage);
    }

    private WhatToDo[] processArguments(String[] args) throws Exception {
        String sopts = "-:HD:h:p:e:buflt";
        LongOpt[] lopts = { new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'H'),
            new LongOpt("host", LongOpt.REQUIRED_ARGUMENT, null, 'h'),
            new LongOpt("port", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
            new LongOpt("encodevalue", LongOpt.NO_ARGUMENT, null, 'e'),
            new LongOpt("setupdb", LongOpt.NO_ARGUMENT, null, 'b'),
            new LongOpt("updatestorageschema", LongOpt.NO_ARGUMENT, null, 'u'),
            new LongOpt("upgrade", LongOpt.NO_ARGUMENT, null, 'g'),
            new LongOpt("listservers", LongOpt.NO_ARGUMENT, null, 'l'),
            new LongOpt("listversions", LongOpt.NO_ARGUMENT, null, 'v'),
            new LongOpt("force", LongOpt.NO_ARGUMENT, null, 'f'), new LongOpt("test", LongOpt.NO_ARGUMENT, null, 't') };

        boolean test = false;
        boolean listservers = false;
        boolean listversions = false;
        boolean setupdb = false;
View Full Code Here

            out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL, getSyntax()));
            return;
        }

        String sopts = "clrs:";
        LongOpt[] lopts = { new LongOpt("check", LongOpt.NO_ARGUMENT, null, 'c'), // check if using primary server
            new LongOpt("list", LongOpt.NO_ARGUMENT, null, 'l'), // show the failover list
            new LongOpt("reset", LongOpt.NO_ARGUMENT, null, 'r'), // reset the failover list iterator
            new LongOpt("switch", LongOpt.REQUIRED_ARGUMENT, null, 's') }; // switch immediately to the given server

        Getopt getopt = new Getopt(getPromptCommandString(), args, sopts, lopts);
        int code;

        while ((code = getopt.getopt()) != -1) {
View Full Code Here

    private void processArguments(AgentMain agent, String[] args) {
        PrintWriter out = agent.getOut();

        String sopts = "deop::sv";
        LongOpt[] lopts = { new LongOpt("disable", LongOpt.NO_ARGUMENT, null, 'd'),
            new LongOpt("enable", LongOpt.NO_ARGUMENT, null, 'e'), new LongOpt("os", LongOpt.NO_ARGUMENT, null, 'o'),
            new LongOpt("ps", LongOpt.OPTIONAL_ARGUMENT, null, 'p'),
            new LongOpt("shutdown", LongOpt.NO_ARGUMENT, null, 's'),
            new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'v') };

        Getopt getopt = new Getopt("native", args, sopts, lopts);
        int code;

        while ((code = getopt.getopt()) != -1) {
View Full Code Here

            out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL, getSyntax()));
            return;
        }

        String sopts = "tdec:f:";
        LongOpt[] lopts = { new LongOpt("comm", LongOpt.REQUIRED_ARGUMENT, null, 'c'), // trace comm messages
            new LongOpt("threaddump", LongOpt.NO_ARGUMENT, null, 't'), // dump thread stacks
            new LongOpt("enable", LongOpt.NO_ARGUMENT, null, 'e'), // shorthand for -f log4j-debug.xml
            new LongOpt("disable", LongOpt.NO_ARGUMENT, null, 'd'), // shorthand for -f log4j.xml
            new LongOpt("file", LongOpt.REQUIRED_ARGUMENT, null, 'f') }; // reconfigure with new log file

        Getopt getopt = new Getopt(getPromptCommandString(), args, sopts, lopts);
        int code;

        while ((code = getopt.getopt()) != -1) {
View Full Code Here

        String executable = null;
        String workingDir = null;
        boolean killOnTimeout = false;

        String sopts = "-cd:E:kw:";
        LongOpt[] lopts = { new LongOpt("capture", LongOpt.NO_ARGUMENT, null, 'c'),
            new LongOpt("killOnTimeout", LongOpt.NO_ARGUMENT, null, 'k'),
            new LongOpt("wait", LongOpt.REQUIRED_ARGUMENT, null, 'w'),
            new LongOpt("directory", LongOpt.REQUIRED_ARGUMENT, null, 'd') };

        Getopt getopt = new Getopt("execute", args, sopts, lopts);
        int code;

        while ((executable == null) && ((code = getopt.getopt()) != -1)) {
View Full Code Here

            out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL, getSyntax()));
            return;
        }

        String sopts = "vudeos";
        LongOpt[] lopts = { new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'v'), // check the version info
            new LongOpt("update", LongOpt.NO_ARGUMENT, null, 'u'), // updates the agent right now
            new LongOpt("disable", LongOpt.NO_ARGUMENT, null, 'd'), // disable agent updates
            new LongOpt("enable", LongOpt.NO_ARGUMENT, null, 'e'), // enable agent updates
            new LongOpt("download", LongOpt.NO_ARGUMENT, null, 'o'), // downloads the agent update binary
            new LongOpt("status", LongOpt.NO_ARGUMENT, null, 's') // status as to whether its enabled/disabled
        };

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

    private void processArguments(AgentMain agent, String[] args) {
        PrintWriter out = agent.getOut();

        String sopts = "-dvr";
        LongOpt[] lopts = { new LongOpt("verbose", LongOpt.NO_ARGUMENT, null, 'v'),
            new LongOpt("recurse", LongOpt.NO_ARGUMENT, null, 'r'),
            new LongOpt("delete", LongOpt.NO_ARGUMENT, null, 'd') };

        Getopt getopt = new Getopt(getPromptCommandString(), args, sopts, lopts);
        int code;
        boolean verbose = false;
        boolean recurse = false;
View Full Code Here

        Integer id = null;
        boolean noRecurse = false;
        boolean sync = false;

        String sopts = "-se:i:ntx";
        LongOpt[] lopts = { new LongOpt("export", LongOpt.REQUIRED_ARGUMENT, null, 'e'), //
            new LongOpt("id", LongOpt.REQUIRED_ARGUMENT, null, 'i'), //
            new LongOpt("norecurse", LongOpt.NO_ARGUMENT, null, 'n'), //
            new LongOpt("sync", LongOpt.NO_ARGUMENT, null, 's'), //
            new LongOpt("types", LongOpt.NO_ARGUMENT, null, 't'), //
            new LongOpt("xml", LongOpt.NO_ARGUMENT, null, 'x') };

        Getopt getopt = new Getopt(getPromptCommandString(), args, sopts, lopts);
        int code;

        while ((inventoryBinaryFile == null) && ((code = getopt.getopt()) != -1)) {
View Full Code Here

            out.println(versionString);
            return true;
        }

        String sopts = "hs::e::";
        LongOpt[] lopts = { new LongOpt("sysprops", LongOpt.OPTIONAL_ARGUMENT, null, 's'),
            new LongOpt("env", LongOpt.OPTIONAL_ARGUMENT, null, 'e'),
            new LongOpt("host", LongOpt.NO_ARGUMENT, null, 'h') };

        out.println(versionString);

        Getopt getopt = new Getopt(getPromptCommandString(), args, sopts, lopts);
        int code;
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.