Examples of CmdLineParser


Examples of org.kohsuke.args4j.CmdLineParser

    * id,b_b_links,b_a_links
    */
    @Override
    public int run(String[] args) throws Exception {
        options = new Options();
        CmdLineParser parser = new CmdLineParser(options);
        String s = options.toString();// for debuging ease

        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            System.err.println(e.getMessage());
            parser.printUsage(System.err);
            return -1;
        }
        fs = FileSystem.get(getConf());

        cleanOutputDirs();
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

  public void realMain(String[] args) throws Exception {
    Map clusterConf = Utils.readStormConfig();
    clusterConf.putAll(Utils.readCommandLineOpts());
    Nimbus.Client client = NimbusClient.getConfiguredClient(clusterConf).getClient();

    CmdLineParser parser = new CmdLineParser(this);
    parser.setUsageWidth(80);
    try {
      // parse the arguments.
      parser.parseArgument(args);
    } catch( CmdLineException e ) {
      // if there's a problem in the command line,
      // you'll get this exception. this will report
      // an error message.
      System.err.println(e.getMessage());
      _help = true;
    }
    if(_help) {
      parser.printUsage(System.err);
      System.err.println();
      return;
    }
    if (_numWorkers <= 0) {
      throw new IllegalArgumentException("Need at least one worker");
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

    public abstract void solve();

    public abstract void prettyOut();

    public final boolean readArgs(String... args) {
        CmdLineParser parser = new CmdLineParser(this);
        parser.setUsageWidth(160);
        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            System.err.println(e.getMessage());
            System.err.println("java " + this.getClass() + " [options...]");
            parser.printUsage(System.err);
            System.err.println();
            return false;
        }
        return true;
    }
View Full Code Here

Examples of org.kohsuke.args4j.CmdLineParser

        run();
    }


    public final void readArgs(String... args) {
        CmdLineParser parser = new CmdLineParser(this);
        parser.setUsageWidth(160);
        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            System.err.println(e.getMessage());
            System.err.println("java " + this.getClass() + " [options...]");
            parser.printUsage(System.err);
            System.err.println();
            System.exit(-1);
        }
    }
View Full Code Here

Examples of org.molgenis.util.cmdline.CmdLineParser

    finally
    {
      IOUtils.closeQuietly(is);
    }

    CmdLineParser parser = new CmdLineParser(this);
    parser.parse(props);
    this.molgenis_properties = propertiesFile;

    // parse passwordfile
    String passwordFile = propertiesFile.replace(".properties", ".passwd");
    this.molgenis_passwd = passwordFile;
    props = new Properties();
    is = null;
    try
    {
      // try to load from local files
      is = new FileInputStream(passwordFile.trim());
      props.load(is);
    }
    catch (FileNotFoundException e)
    {
      InputStream is2 = ClassLoader.getSystemResourceAsStream(passwordFile.trim());
      try
      {
        // try to load from classpath
        props.load(is2);
      }
      catch (Exception e2)
      {
        // no biggie
      }
      finally
      {
        IOUtils.closeQuietly(is2);
      }
    }
    finally
    {
      IOUtils.closeQuietly(is);
    }
    parser = new CmdLineParser(this);
    parser.parse(props);

    // warn if no password was provided
    if ("".equals(this.db_password)) System.err.println("WARNING: db_password was not provided in neither "
        + propertiesFile + " nor " + passwordFile);
View Full Code Here

Examples of org.rhq.enterprise.client.script.CmdLineParser

            initBindings(client);
        }

        if (isScriptFileCommandLine(args)) {
            try {
                CmdLineParser cmdLineParser = new CmdLineParser();
                ScriptCmdLine scriptCmdLine = cmdLineParser.parse(args);

                bindScriptArgs(client, scriptCmdLine);
                executeUtilScripts(client);

                FileReader reader = new FileReader(scriptCmdLine.getScriptFileName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.