Package org.apache.commons.cli

Examples of org.apache.commons.cli.CommandLineParser



  @SuppressWarnings("static-access")
  public static void parseArgs(String[] args) throws IOException
  {
      CommandLineParser cliParser = new GnuParser();


      Option helpOption = OptionBuilder.withLongOpt(HELP_OPT_LONG_NAME)
                                     .withDescription("Help screen")
                                     .create(HELP_OPT_CHAR);

      Option dbOption = OptionBuilder.withLongOpt(BOOTSTRAP_DB_PROPS_OPT_LONG_NAME)
                                  .withDescription("Bootstrap Cleaner and DB properties to use")
                                  .hasArg()
                                  .withArgName("property_file")
                                  .create(BOOTSTRAP_DB_PROP_OPT_CHAR);

      Option cmdLinePropsOption1 = OptionBuilder.withLongOpt(CLEANER_CMD_LINE_PROPS_OPT_LONG_NAME)
                      .withDescription("Cmd line override of cleaner config properties. Semicolon separated.")
                      .hasArg()
                      .withArgName("Semicolon_separated_properties")
                      .create(CLEANER_CMD_LINE_PROPS_OPT_CHAR);

    Option log4jPropsOption = OptionBuilder.withLongOpt(LOG4J_PROPS_OPT_LONG_NAME)
                  .withDescription("Log4j properties to use")
                  .hasArg()
                  .withArgName("property_file")
                  .create(LOG4J_PROPS_OPT_CHAR);

      Option sourcesOption = OptionBuilder.withLongOpt(BOOTSTRAP_SOURCES_OPT_LONG_NAME)
              .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);
      }
      catch (ParseException pe)
      {
      LOG.error("Bootstrap Physical Config: failed to parse command-line options.", pe);
        throw new RuntimeException("Bootstrap Physical Config: failed to parse command-line options.", pe);
View Full Code Here


  public static void main(String[] args) throws Exception
  {
   
    String sdmxFilePath = "";
    String logFilePath = "";
    CommandLineParser parser = new BasicParser( );
    Options options = new Options( );
   
    options.addOption("i", "file path", true, "sdmx file path.");
    options.addOption("l", "log file path", true, "File path where the logs will be generated");
   
    CommandLine commandLine = parser.parse( options, args );
   
    if(commandLine.hasOption('i'))
      sdmxFilePath = commandLine.getOptionValue('i');
       
    if(commandLine.hasOption('l'))
View Full Code Here

 
  public static void main(String[] args) throws Exception
  {
    DatasetTitles obj = new DatasetTitles();
   
    CommandLineParser parser = new BasicParser( );
    Options options = new Options( );
    options.addOption("h", "help", false, "Print this usage information.");
    options.addOption("i", "inputFilepath", true, "Local ToC file.");
    options.addOption("o", "outputFilePath", true, "Output directory path to generate the file.");
    options.addOption("f", "format", true, "RDF format for serialization (RDF/XML, TURTLE, N-TRIPLES).");

    CommandLine commandLine = parser.parse( options, args );
   
    if( commandLine.hasOption('h') ) {
        usage();
        return;
     }
View Full Code Here

  }

  @SuppressWarnings("static-access")
  public static void parseArgs(String[] args) throws IOException
  {
    CommandLineParser cliParser = new GnuParser();


    Option outputDirOption = OptionBuilder.withLongOpt(OUTPUT_DIR_OPT_LONG_NAME)
        .withDescription("Help screen")
        .create(OUTPUT_DIR_OPT_CHAR);

    Options options = new Options();
    options.addOption(outputDirOption);


    CommandLine cmd = null;
    try
    {
      cmd = cliParser.parse(options, args);
    }
    catch (ParseException pe)
    {
      LOG.fatal("Bootstrap Avro Record Dumper: failed to parse command-line options.", pe);
      throw new RuntimeException("Bootstrap Avro Record Dumper: failed to parse command-line options.", pe);
View Full Code Here

    System.out.println("  (optional)-f format  RDF format for serialization (RDF/XML, TURTLE, N-TRIPLES).");
  }
 
  public static void main(String[] args) throws Exception
  {
    CommandLineParser parser = new BasicParser( );
    Options options = new Options( );
    options.addOption("h", "help", false, "Print this usage information");
    options.addOption("i", "dictionaryPath", true, "Directory path where the dictionary files are stored.");
    options.addOption("o", "outputPath", true, "Output directory path where the RDF representation of dictionaries will be created.");
    options.addOption("c", "catalog Path", true, "Output directory path where the catalog file will be created.");
    options.addOption("f", "format", true, "RDF format for serialization (RDF/XML, TURTLE, N-TRIPLES).");
    CommandLine commandLine = parser.parse( options, args );

    if( commandLine.hasOption('h') ) {
        usage();
        return;
     }
View Full Code Here

  }

  @SuppressWarnings("static-access")
  public static void parseArgs(String[] args) throws IOException
  {
    CommandLineParser cliParser = new GnuParser();


        Option helpOption = OptionBuilder.withLongOpt(HELP_OPT_LONG_NAME)
                                       .withDescription("Help screen")
                                       .create(HELP_OPT_CHAR);

      Option sourcesOption = OptionBuilder.withLongOpt(PHYSICAL_CONFIG_OPT_LONG_NAME)
                                     .withDescription("Bootstrap producer properties to use")
                                     .hasArg()
                                     .withArgName("property_file")
                                     .create(PHYSICAL_CONFIG_OPT_CHAR);

      Option dbOption = OptionBuilder.withLongOpt(BOOTSTRAP_DB_PROPS_OPT_LONG_NAME)
                      .withDescription("Bootstrap producer properties to use")
                      .hasArg()
                      .withArgName("property_file")
                      .create(BOOTSTRAP_DB_PROP_OPT_CHAR);

      Option log4jPropsOption = OptionBuilder.withLongOpt(LOG4J_PROPS_OPT_LONG_NAME)
                        .withDescription("Log4j properties to use")
                        .hasArg()
                        .withArgName("property_file")
                        .create(LOG4J_PROPS_OPT_CHAR);

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

      CommandLine cmd = null;
      try
      {
        cmd = cliParser.parse(options, args);
      }
      catch (ParseException pe)
      {
        LOG.fatal("Bootstrap Physical Config: failed to parse command-line options.", pe);
        throw new RuntimeException("Bootstrap Physical Config: failed to parse command-line options.", pe);
View Full Code Here

  }

  @SuppressWarnings("static-access")
  public static void parseArgs(String[] args) throws IOException
  {
    CommandLineParser cliParser = new GnuParser();


        Option helpOption = OptionBuilder.withLongOpt(HELP_OPT_LONG_NAME)
                                       .withDescription("Help screen")
                                       .create(HELP_OPT_CHAR);

      Option sourcesOption = OptionBuilder.withLongOpt(PHYSICAL_CONFIG_OPT_LONG_NAME)
                                     .withDescription("Bootstrap producer properties to use")
                                     .hasArg()
                                     .withArgName("property_file")
                                     .create(PHYSICAL_CONFIG_OPT_CHAR);

      Option dbOption = OptionBuilder.withLongOpt(BOOTSTRAP_DB_PROPS_OPT_LONG_NAME)
                      .withDescription("Bootstrap producer properties to use")
                      .hasArg()
                      .withArgName("property_file")
                      .create(BOOTSTRAP_DB_PROP_OPT_CHAR);

      Option log4jPropsOption = OptionBuilder.withLongOpt(LOG4J_PROPS_OPT_LONG_NAME)
                        .withDescription("Log4j properties to use")
                        .hasArg()
                        .withArgName("property_file")
                        .create(LOG4J_PROPS_OPT_CHAR);

      Option validationType = OptionBuilder.withLongOpt(VALIDATION_TYPE_OPT_LONG_NAME)
                  .withDescription("Type of validation algorithm , normal[cmp two sorted streams of oracle and bootstrap db]  or point[entry in bootstrap checked in oracle]")
                  .hasArg()
                  .withArgName("validation_type")
                  .create(VALIDATION_TYPE_OPT_CHAR);

      Option validationSamplePct = OptionBuilder.withLongOpt(VALIDATION_SAMPLE_PCT_LONG_NAME)
          .withDescription("Validation sample pct ,0.0 to 100.00 [100.0]")
          .hasArg()
          .withArgName("validation_sample_pct")
          .create(VALIDATION_SAMPLE_PCT_CHAR);

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


      CommandLine cmd = null;
      try
      {
        cmd = cliParser.parse(options, args);
      }
      catch (ParseException pe)
      {
        LOG.fatal("Bootstrap Physical Config: failed to parse command-line options.", pe);
        throw new RuntimeException("Bootstrap Physical Config: failed to parse command-line options.", pe);
View Full Code Here

  }
 
  public static void main(String[] args) throws Exception
  {
   
    CommandLineParser parser = new BasicParser( );
    Options options = new Options( );
    options.addOption("h", "help", false, "Print this usage information");
    options.addOption("p", "path", true, "Directory path for downloading the zip files.");
    options.addOption("t", "path", true, "Directory path for downloading the compressed tsv files.");
   
    CommandLine commandLine = parser.parse( options, args );

    if( commandLine.hasOption('h') ) {
        usage();
        return;
     }
View Full Code Here

 
  public static void main(String[] args) throws Exception
  {
    String url = "";
   
    CommandLineParser parser = new BasicParser( );
    Options options = new Options( );
    options.addOption("h", "help", false, "Print this usage information");
    options.addOption("p", "path", true, "Directory path for downloading the compressed zip files.");
    options.addOption("u", "zip", true, "URL of the compressed file.");
    options.addOption("t", "tsv", true, "Directory path for downloading the compressed tsv files.");
   
    CommandLine commandLine = parser.parse( options, args );

    if( commandLine.hasOption('h') ) {
        usage();
        return;
     }
View Full Code Here

    }

    public static void main(String[] args) throws Exception
    {

        CommandLineParser parser = new BasicParser( );
        Options options = new Options( );
        options.addOption("h", "help", false, "Print this usage information");
        options.addOption("i", "inputFilepath", true, "Local ToC file.");
        options.addOption("o", "outputFilepath", true, "Output directory path to generate the metadata files.");
        options.addOption("f", "format", true, "RDF format for serialization (RDF/XML, TURTLE, N-TRIPLES).");
        CommandLine commandLine = parser.parse( options, args );

        if( commandLine.hasOption('h') ) {
            usage();
            return;
         }
View Full Code Here

TOP

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

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.