Package org.apache.commons.cli

Examples of org.apache.commons.cli.PosixParser


        ApplicationService applicationService = dspace.getServiceManager().getServiceByName(
                "applicationService", ApplicationService.class);
       
    String excelFilePath = null;

    CommandLineParser parser = new PosixParser();

    Options options = new Options();
    options.addOption("h", "help", false, "help");

    options.addOption("f", "file", true, "File xml to import");

    // allen's added argument
    options.addOption("active", "active", false,
        "Set newly created epersons active");
    options.addOption("inactive", "inactive", false,
        "Set newly created epersons inactive");
     
    // active or inactive for newly created epersons. Default is inactive.
    boolean status = 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


            options.addOption(opt);
        }

        try
        {
            line = new PosixParser().parse(options, argv);
        }
        catch (Exception e)
        {
            // automatically generate the help statement
            formatter.printHelp(usage, e.getMessage(), options, "");
View Full Code Here

        DSpace dspace = new DSpace();
        VisualizationGraphSolrService service = dspace.getServiceManager()
                .getServiceByName("visualNetworkSolrService",
                        VisualizationGraphSolrService.class);

        CommandLineParser parser = new PosixParser();

        Options options = new Options();
        options.addOption("h", "help", false, "help");
        options.addOption("a", "all_connections", false,
                "Work on all connections read from configuration");
        options.addOption("s", "single_connection", true,
                "Work on single connection");
       
        CommandLine line = parser.parse(options, args);

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

        DSpace dspace = new DSpace();
        VisualizationGraphSolrService service = dspace.getServiceManager()
                .getServiceByName("visualNetworkSolrService",
                        VisualizationGraphSolrService.class);

        CommandLineParser parser = new PosixParser();

        Options options = new Options();
        options.addOption("h", "help", false, "help");
        options.addOption("a", "all_connections", false,
                "Work on all connections read from configuration");
        options.addOption("s", "single_connection", true,
                "Work on single connection");
        options.addOption("d", "departments", false,
                "At end index departmental network");

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

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

        ApplicationService applicationService = dspace.getServiceManager()
                .getServiceByName("applicationService",
                        ApplicationService.class);

        CommandLineParser parser = new PosixParser();

        Options options = new Options();
        options.addOption("h", "help", false, "help");
        options.addOption("a", "all_connections", false,
                "Work on all connections read from configuration");
        options.addOption("s", "single_connection", true,
                "Work on single connection");

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

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

            DSpace dspace = new DSpace();
            ApplicationService applicationService = dspace.getServiceManager().getServiceByName(
                    "applicationService", ApplicationService.class);

            CommandLineParser parser = new PosixParser();

            Options options = new Options();
            options.addOption("h", "help", false, "help");

            options.addOption("r", "researcher", true, "RP id to delete");

            options.addOption("s", "silent", false, "no interactive mode");

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

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

        DSpace dspace = new DSpace();
        ApplicationService applicationService = dspace.getServiceManager().getServiceByName(
                "applicationService", ApplicationService.class);

        CommandLineParser parser = new PosixParser();

        Options options = new Options();
        options.addOption("h", "help", false, "help");
        options.addOption("a", "all_researcher", false,
                "Work on all researchers pages");
        options.addOption("s", "single_researcher", true,
                "Work on single researcher");
        options.addOption("d", "MODE_DATE", true,
                "Script work only on RP names modified since the date");
        options.addOption("D", "MODE_HOUR", true,
                "Script work only on RP names modified in the last n hours");

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

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

            options.addOption(opt);
        }

        try
        {
            line = new PosixParser().parse(options, argv);
        }
        catch (Exception e)
        {
            // automatically generate the help statement
            formatter.printHelp(usage, e.getMessage(), options, "");
View Full Code Here

        RelationPreferenceService relationPreferenceService = dspace.getServiceManager().getServiceByName(
                "org.dspace.app.cris.service.RelationPreferenceService", RelationPreferenceService.class);
        ApplicationService applicationService = dspace.getServiceManager().getServiceByName(
                "applicationService", ApplicationService.class);
       
        CommandLineParser parser = new PosixParser();

        Options options = new Options();
        options.addOption("h", "help", false, "help");
        options.addOption("a", "all_researcher", false,
                "Work on all researchers pages");
        options.addOption("s", "single_researcher", true,
                "Work on single researcher");
        options.addOption("d", "MODE_DATE", true,
                "Script work only on RP names modified after this date");
        options.addOption("D", "MODE_HOUR", true,
                "Script work only on RP names modified in this hours range");

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

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


    public CommandLine getCommandLine( String command, String[] args )
    {
        Options all = allOptions( command );
        CommandLineParser parser = new PosixParser();
        CommandLine cmdline = null;
        try
        {
            cmdline = parser.parse( all, args );
        }
        catch ( AlreadySelectedException ase )
        {
            System.err.println( I18n.err( I18n.ERR_187, command, ase.getLocalizedMessage() ) );
            System.exit( 1 );
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.