Package org.apache.commons.cli

Examples of org.apache.commons.cli.Option


  @SuppressWarnings("static-access")
  public AvroConvertCli()
  {

    Option helpOption = OptionBuilder.withLongOpt(HELP_OPT_NAME)
                                     .withDescription("this help screen")
                                     .create(HELP_OPT_CHAR);
    Option inpFormatOption = OptionBuilder.withLongOpt(INPUT_FORMAT_OPT_NAME)
                                          .withDescription("Input format: JSON, JSON_LINES, BINARY")
                                          .hasArg()
                                          .withArgName("format")
                                          .create(INPUT_FORMAT_OPT_CHAR);
    Option outFormatOption = OptionBuilder.withLongOpt(OUTPUT_FORMAT_OPT_NAME)
                                          .withDescription("Output format: JSON, JSON_LINES, BINARY")
                                          .hasArg()
                                          .withArgName("format")
                                          .create(OUTPUT_FORMAT_OPT_CHAR);
    Option inpSchemaOption = OptionBuilder.withLongOpt(INPUT_SCHEMA_OPT_NAME)
                                          .withDescription("Input schema file")
                                          .hasArg()
                                          .withArgName("file")
                                          .create(INPUT_SCHEMA_OPT_CHAR);
    Option outSchemaOption = OptionBuilder.withLongOpt(OUTPUT_SCHEMA_OPT_NAME)
                                          .withDescription("Output schema file")
                                          .hasArg()
                                          .withArgName("file")
                                          .create(OUTPUT_SCHEMA_OPT_CHAR);
    Option inpFileOption = OptionBuilder.withLongOpt(INPUT_FILE_OPT_NAME)
                                        .withDescription("input file name or - for STDIN")
                                        .hasArg()
                                        .withArgName("file | - ")
                                        .create(INPUT_FILE_OPT_CHAR);
    Option outFileOption = OptionBuilder.withLongOpt(OUTPUT_FILE_OPT_NAME)
                                        .withDescription("output file name or - for STDOUT")
                                        .hasArg()
                                        .withArgName("file | - ")
                                        .create(OUTPUT_FILE_OPT_CHAR);
    Option verboseOption = OptionBuilder.withDescription("verbose; more occurrences increase verbosity")
                                        .create(VERBOSE_OPT_CHAR);

    _options.addOption(helpOption);
    _options.addOption(inpFormatOption);
    _options.addOption(outFormatOption);
View Full Code Here


    }

    @SuppressWarnings("static-access")
    protected void constructCommandLineOptions()
    {
      Option helpOption = OptionBuilder.withLongOpt(HELP_OPT_LONG_NAME)
                                       .withDescription("Prints command-line options info")
                                       .create(HELP_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 debugPropsOption = OptionBuilder.withLongOpt(DEBUG_OPT_LONG_NAME)
                                             .withDescription("Turns on debugging info")
                                             .create(DEBUG_OPT_CHAR);
      Option containerPropsOption = OptionBuilder.withLongOpt(CONTAINER_PROPS_OPT_LONG_NAME)
                                                 .withDescription("Container config properties to use")
                                                 .hasArg()
                                                 .withArgName("property_file")
                                                 .create(CONTAINER_PROPS_OPT_CHAR);
      Option cmdLinePropsOption = OptionBuilder.withLongOpt(CMD_LINE_PROPS_OPT_LONG_NAME)
                                                 .withDescription("Cmd line override of config properties. Semicolon separated.")
                                                 .hasArg()
                                                 .withArgName("Semicolon_separated_properties")
                                                 .create(CMD_LINE_PROPS_OPT_CHAR);
View Full Code Here

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


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

    Option sourceIdOption = OptionBuilder.withLongOpt(SOURCE_ID_OPT_LONG_NAME)
        .withDescription("Source ID for which tables need to be added")
        .hasArg()
        .withArgName("Source ID")
        .create(SOURCE_ID_OPT_CHAR);

    Option sourceNameOption = OptionBuilder.withLongOpt(SOURCE_NAME_OPT_LONG_NAME)
        .withDescription("Source Name for which tables need to be added")
        .hasArg()
        .withArgName("Source ID")
        .create(SOURCE_NAME_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 cmdLinePropsOption = OptionBuilder.withLongOpt(CMD_LINE_PROPS_OPT_LONG_NAME)
        .withDescription("Cmd line override of config properties. Semicolon separated.")
        .hasArg()
        .withArgName("Semicolon_separated_properties")
        .create(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);
View Full Code Here

    @Override
    protected void constructCommandLineOptions()
    {
      super.constructCommandLineOptions();

      Option actionOption = OptionBuilder.withArgName("action")
                                         .hasArg()
                                         .withLongOpt(ACTION_OPTION_NAME)
                                         .withDescription("action:" + Action.generateActionList())
                                         .create(ACTION_OPTION_CHAR);
      Option srcidOption = OptionBuilder.withArgName("srcid")
                                        .hasArg()
                                        .withLongOpt(SRCID_OPTION_NAME)
                                        .withDescription("action:")
                                        .create(SRCID_OPTION_CHAR);
View Full Code Here

  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);
View Full Code Here

  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);
View Full Code Here

  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);
View Full Code Here

  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);
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(QUERY_CONFIG_OPT_LONG_NAME)
                                        .withDescription("Query Config")
                                        .hasArg()
                                        .withArgName("property_file")
                                        .create(QUERY_CONFIG_OPT_CHAR);

    Option dbOption = OptionBuilder.withLongOpt(BOOTSTRAP_DB_PROPS_OPT_LONG_NAME)
                                   .withDescription("Bootstrap DB 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();
View Full Code Here

  public static int 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 sourceIdOption = OptionBuilder.withLongOpt(SOURCE_ID_OPT_LONG_NAME)
                                     .withDescription("Source ID for which tables need to be dropped")
                                     .hasArg()
                                     .withArgName("Source ID")
                                     .create(SOURCE_ID_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 cmdLinePropsOption = OptionBuilder.withLongOpt(CMD_LINE_PROPS_OPT_LONG_NAME)
                                    .withDescription("Cmd line override of config properties. Semicolon separated.")
                                    .hasArg()
                                    .withArgName("Semicolon_separated_properties")
                                    .create(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);
View Full Code Here

TOP

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

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.