Package org.apache.commons.cli

Examples of org.apache.commons.cli.PosixParser


        .hasArgs(1)
        .withDescription(
            "Sets the compression codec for the map compress output setting. (SNAPPY,GZIP,BZIP,DEFAULT, or classname)")
        .create("p"));

    CommandLineParser parser = new PosixParser();
    CommandLine cmd = null;
    try {
      cmd = parser.parse(options, otherArgs);
    } catch (ParseException e) {
      System.err.println(e.getMessage());
      HelpFormatter formatter = new HelpFormatter();
      PrintWriter pw = new PrintWriter(System.err, true);
      formatter.printHelp(pw, DEFAULT_WIDTH, CSVLOADER, HEADER, options, HelpFormatter.DEFAULT_LEFT_PAD,
View Full Code Here


    if (args.length == 0) {
      HelpFormatter formatter = new HelpFormatter();
      formatter.printHelp("HFile", options, true);
      return false;
    }
    CommandLineParser parser = new PosixParser();
    CommandLine cmd = parser.parse(options, args);

    verbose = cmd.hasOption("v");
    printValue = cmd.hasOption("p");
    printKey = cmd.hasOption("e") || printValue;
    shouldPrintMeta = cmd.hasOption("m");
View Full Code Here

        String port = null;
        String file = null;
        String test = null;
       
        Options options = generateOptions();
        CommandLineParser parser = new PosixParser();

        try {
            CommandLine line = parser.parse(options, args);
           
            ip = line.getOptionValue(CHAR_IP);
            port = line.getOptionValue(CHAR_PORT);
            file = line.getOptionValue(CHAR_FILE);
            test = line.getOptionValue(CHAR_TESTNAME);
View Full Code Here

     */
    public static void main(String[] args) throws IOException, ConfigurationException
    {
        String usage = String.format("Usage: %s <sstable> [-k key [-k key [...]] -x key [-x key [...]]]%n", SSTableExport.class.getName());

        CommandLineParser parser = new PosixParser();
        try
        {
            cmd = parser.parse(options, args);
        }
        catch (ParseException e1)
        {
            System.err.println(e1.getMessage());
            System.err.println(usage);
View Full Code Here

        if (args.length == 0) {
            showUsage(options);
            System.exit(1);
        }
       
        CommandLineParser parser = new PosixParser();
        CommandLine cmd = parser.parse(options, args);
       
        if (cmd.hasOption('h')) {
            showUsage(options);
            System.exit(1);
        }
View Full Code Here

    protected boolean parseCommandline(final String[] args)
    {
        try
        {
            _commandLine = new PosixParser().parse(OPTIONS, args);

            return true;
        }
        catch (ParseException e)
        {
View Full Code Here

    public static final void main(String args[]) throws Exception {
        final ReportConfiguration configuration = new ReportConfiguration();
        configuration.setHeaderMatcher(Defaults.createDefaultMatcher());
        Options opts = buildOptions();

        PosixParser parser = new PosixParser();
        CommandLine cl = null;
        try {
            cl = parser.parse(opts, args);
        } catch (ParseException e) {
            System.err.println("Please use the \"--help\" option to see a list of valid commands and options");
            System.exit(1);
        }
View Full Code Here

        throws MavenExecutorException
    {
        try
        {
            String[] args = CommandLineUtils.translateCommandline( additionalArguments );
            CommandLine cli = new PosixParser().parse( OPTIONS, args );

            if ( cli.hasOption( SET_SYSTEM_PROPERTY ) )
            {
                String[] properties = cli.getOptionValues( SET_SYSTEM_PROPERTY );
                Properties props = new Properties();
View Full Code Here

        DSpace dspace = new DSpace();

        SolrLogger indexer = dspace.getServiceManager().getServiceByName(
                SolrLogger.class.getName(), SolrLogger.class);

        CommandLineParser parser = new PosixParser();

        Options options = new Options();

        options.addOption("u", "update-spider-files", false,
                "Update Spider IP Files from internet into "
                        + ConfigurationManager.getProperty("dspace.dir")
                        + "/config/spiders");

        options.addOption("m", "mark-spiders", false,
                "Update isBog Flag in Solr");
        options.addOption("f", "delete-spiders-by-flag", false,
                "Delete Spiders in Solr By isBot Flag");
        options.addOption("i", "delete-spiders-by-ip", false,
                "Delete Spiders in Solr By IP Address");
        options.addOption("h", "help", false, "help");
        options.addOption("b", "mark-spiders-by-useragent", true,
                "Update isBot Flag in Solr By User Agent");
        CommandLine line = parser.parse(options, args);

        // Did the user ask to see the help?
        if (line.hasOption('h'))
        {
            printHelp(options, 0);
View Full Code Here

    dspaceContext.setIgnoreAuthorization(true);
    DSpace dspace = new DSpace();
    ApplicationService applicationService = dspace.getServiceManager()
        .getServiceByName("applicationService",
            ApplicationService.class);
    CommandLineParser parser = new PosixParser();

    String xmlFilePath = null;

    Options options = new Options();
    options.addOption("rpmode", "rpmode", false, "if this check exist then import from internal database");
    options.addOption("f", "file", true, "File xml to import");
    options.addOption("h", "help", false, "help");

    options.addOption("status", "status", false, "Get active RPs only");
    options.addOption("active", "active", false,
        "Set active true newly created grants public");
    options.addOption("newly", "newly", false,
        "Get only newly grants find on rps");

    // RPs status flag. Default is get public RPs
    boolean status = false;
    // RGs active flag. Default is inactive.
    boolean active = false;
    // Import only newly grants (with new grantCode)
    boolean newly = false;

    CommandLine line = parser.parse(options, args);

    if (line.hasOption('h')) {
      HelpFormatter myhelp = new HelpFormatter();
      myhelp.printHelp("ScriptHRURP \n", options);
      System.out
View Full Code Here

TOP

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

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.