Package org.apache.commons.cli

Examples of org.apache.commons.cli.Options


  private static void parseArgs(String[] args) throws Exception
  {
      CommandLineParser cliParser = new GnuParser();

      Options options = createOptions();

      CommandLine cmd = null;
      try
      {
        cmd = cliParser.parse(options, args);
View Full Code Here


    public static void main(String[] args)
    {
        try
        {
            GnuParser cmdLineParser = new GnuParser();
            Options options = new Options();
            options.addOption("z", true, "zk-server")
                    .addOption("c", true, "cluster-name ")
                    .addOption("p", true, "partition")
                    .addOption("l", false, "legacy")
                    .addOption("h", false, "help");
            CommandLine cmdLineArgs = cmdLineParser.parse(options, args, false);
View Full Code Here

  private static String  _filterConfFile = null;
  private static String[] _sources = null;

  protected static Options constructCommandLineOptions()
  {
    Options options = new Options();
    options.addOption(RELAY_HOST_OPT_NAME, true, "Relay Host Name");
    options.addOption(RELAY_PORT_OPT_NAME, true, "Relay Port");
    options.addOption(EVENT_DUMP_FILE_OPT_NAME, true, "File to dump event");
    options.addOption(VALUE_DUMP_FILE_OPT_NAME, true, "File to dump deserilized values");
    options.addOption(HTTP_PORT_OPT_NAME, true, "Consumer http port");
    options.addOption(JMX_SERVICE_PORT_OPT_NAME, true, "Consumer jmx service port");
    options.addOption(CHECKPOINT_DIR, true, "Checkpoint dir");
    options.addOption(BOOTSTRAP_HOST_OPT_NAME, true, "Bootstrap server Name");
    options.addOption(BOOTSTRAP_PORT_OPT_NAME, true, "Bootstrap server Port");
    options.addOption(EVENT_PATTERN_OPT_NAME, true, "Event Pattern Name to Check");
    options.addOption(FILTER_CONF_FILE_OPT_NAME, true, "Server Side Filter Config");
    options.addOption(SOURCES_OPT_NAME,true,"Comma seperated source names");
    return options;
  }
View Full Code Here

  }

  protected static String[] processLocalArgs(String[] cliArgs) throws IOException, ParseException
  {
    CommandLineParser cliParser = new GnuParser();
    Options cliOptions = constructCommandLineOptions();

    CommandLine cmd = cliParser.parse(cliOptions, cliArgs, true);
    // Options here has to be up front
    if (cmd.hasOption(RELAY_HOST_OPT_NAME))
    {
View Full Code Here

   */
  public static void main(String[] args) {
    try
    {
      GnuParser cmdLineParser  = new GnuParser();
      Options options = new Options();
      options.addOption("n",true,"Zookeeper namespace  [/DatabusClient")
      .addOption("g",true,"Groupname [default-group-name] ")
      .addOption("d",true,"Shared directory name [shareddata] ")
      .addOption("s",true,"Zookeeper server list [localhost:2181] ")
      .addOption("h",false,"help");
      CommandLine cmdLineArgs  = cmdLineParser.parse(options, args,false);
View Full Code Here

    }

    public Cli(String usage)
    {
      _usage = usage;
      _cliOptions = new Options();
      _helpFormatter = new HelpFormatter();
      _helpFormatter.setWidth(150);
    }
View Full Code Here

    String tempTsvPath = "";
    String originalTSVPath = "";
    String sdmxTTLFile = "";
   
    CommandLineParser parser = new BasicParser( );
    Options options = new Options( );
    options.addOption("h", "help", false, "Print this usage information");
    options.addOption("i", "file path", true, "Input file path of the TableOfContents.xml file.");
    options.addOption("o", "output file path", true, "Output directory path where the new TableOfContents.xml file will be saved.");
    options.addOption("f", "log file path", true, "Output directory path where the log of updates will be stored.");
    options.addOption("z", "temp zip path", true, "Directory path where zip files will be temporarily stored.");
    options.addOption("v", "temp tsv path", true, "Directory path where tsv files will be temporarily stored.");
    options.addOption("t", "temp data path", true, "Directory path where the sdmx and dsd files will be temporarily stored.");
    options.addOption("s", "sdmx file path", true, "Output directory path to generate DataCube representation of observations.");
    options.addOption("d", "dsd file path", true, "Output directory path to generate DataCube representation of DSD.");
    options.addOption("l", "data log path", true, "File path where the logs will be written.");
    options.addOption("p", "original data path", true, "Path where zip files will be stored.");
    options.addOption("b", "original tsv path", true, "Path where tsv files will be stored.");
    options.addOption("r", "raw data path", true, "Path where the uncompressed files will be stored.");
    options.addOption("a", "sdmx ttl file", true, "Path where the sdmx ttl is located.");
    CommandLine commandLine = parser.parse( options, args );
   
    if( commandLine.hasOption('h') ) {
        usage();
        return;
View Full Code Here

        .withDescription("Log4j properties to use")
        .hasArg()
        .withArgName("property_file")
        .create(LOG4J_PROPS_OPT_CHAR);

    Options options = new Options();
    options.addOption(helpOption);
    options.addOption(sourceIdOption);
    options.addOption(sourceNameOption);
    options.addOption(dbOption);
    options.addOption(cmdLinePropsOption);
    options.addOption(log4jPropsOption);

    CommandLine cmd = null;
    try
    {
      cmd = cliParser.parse(options, args);
View Full Code Here

    String fileName = "";
    String sdmxFilePath = "";
    String tsvFilePath = "";
   
    CommandLineParser parser = new BasicParser( );
    Options options = new Options( );
    options.addOption("h", "help", false, "Print this usage information");
    options.addOption("f", "filename", true, "Name of the file.");
    options.addOption("i", "file path", true, "File path of the SDMX xml file.");
    options.addOption("t", "tsv file path", true, "File path of the SDMX tsv file.");
    options.addOption("o", "output file path", true, "Output directory path to generate DataCube representation of observations");
    options.addOption("l", "log file path", true, "File path where the logs will be written.");
   
    CommandLine commandLine = parser.parse( options, args );
   
    if( commandLine.hasOption('h') ) {
        usage();
View Full Code Here

              .withDescription("Comma seperated list of sourceNames. If not provided, no source will be cleaned up")
              .hasArg()
              .withArgName("comma-seperated sources")
              .create(BOOTSTRAP_SOURCES_PROP_OPT_CHAR);

      Options options = new Options();
      options.addOption(helpOption);
      options.addOption(dbOption);
      options.addOption(cmdLinePropsOption1);
    options.addOption(log4jPropsOption);
    options.addOption(sourcesOption);

      CommandLine cmd = null;
      try
      {
        cmd = cliParser.parse(options, args);
View Full Code Here

TOP

Related Classes of org.apache.commons.cli.Options

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.