Examples of CommandLine


Examples of org.exolab.jms.util.CommandLine

    //////////////////////////////////////////////////////////////////////////////////////
    // Mainline
    public static void main(String[] args)
    throws Exception {
        CommandLine line  = new CommandLine(args);
        if (line.exists("props")) {
            Properties props = new Properties(System.getProperties());
            props.load(new BufferedInputStream(new FileInputStream(line.value("props"))));
            System.setProperties(props);

            Controller controller = new Controller();
            while(true);
        } else {
View Full Code Here

Examples of org.jboss.aesh.cl.CommandLine

            if (output != null && output.getBuffer().trim().length() > 0) {
                try (CommandContainer commandContainer = getCommand(
                        Parser.findFirstWord(output.getBuffer()),
                        output.getBuffer())) {

                    CommandLine commandLine = commandContainer.getParser()
                            .parse(output.getBuffer());

                    commandContainer
                            .getParser()
                            .getCommandPopulator()
                            .populateObject(commandContainer.getCommand(),
                                    commandLine, invocationProviders, true);
                    // validate the command before execute, only call if no
                    // options with overrideRequired is not set
                    if (commandContainer.getParser().getCommand()
                            .getValidator() != null
                            && !commandLine.hasOptionWithOverrideRequired())
                        commandContainer.getParser().getCommand()
                                .getValidator()
                                .validate(commandContainer.getCommand());
                    result = commandContainer
                            .getCommand()
View Full Code Here

Examples of org.jnode.shell.CommandLine

        shell.addSyntax("cmd", new OptionSetSyntax(new OptionSyntax("intArg", 'i'),
                new OptionSyntax("fileArg", 'f'), new OptionSyntax("flagArg1", 'x'),
                new OptionSyntax("flagArg2", 'y'), new OptionSyntax("flagArg3", 'z'),
                new OptionSyntax("flagArg4", "boring")));

        CommandLine cl;
        CommandInfo cmdInfo;
        Command cmd;

        cl = new CommandLine(new Token("cmd"), new Token[] {}, null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);

        cl =
                new CommandLine(new Token("cmd"), new Token[] {new Token("-f"), new Token("F1")},
                        null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);
        Assert.assertEquals("F1", cmd.getArgumentBundle().getArgument("fileArg").getValue()
                .toString());

        cl =
                new CommandLine(new Token("cmd"), new Token[] {new Token("-f"), new Token("F1"),
                    new Token("-x"), new Token("-yz")}, null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg1").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg2").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg3").getValues().length);

        cl = new CommandLine(new Token("cmd"), new Token[] {new Token("-yz")}, null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("flagArg1").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg2").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg3").getValues().length);

        try {
            cl = new CommandLine(new Token("cmd"), new Token[] {new Token("-xya")}, null);
            cl.parseCommandLine(shell);
            Assert.fail("no exception");
        } catch (CommandSyntaxException ex) {
            // expected
        }

        try {
            cl = new CommandLine(new Token("cmd"), new Token[] {new Token("-")}, null);
            cl.parseCommandLine(shell);
            Assert.fail("no exception");
        } catch (CommandSyntaxException ex) {
            // expected
        }
    }
View Full Code Here

Examples of org.jpox.util.CommandLine

     * Constructor
     */
    public SchemaTool()
    {
        omfContext = new OMFContext(this);
        cmd = new CommandLine();
        cmd.addOption("create", "create", null, LOCALISER.msg(false, "014026"));
        cmd.addOption("delete", "delete", null, LOCALISER.msg(false, "014027"));
        cmd.addOption("validate", "validate", null, LOCALISER.msg(false, "014028"));
        cmd.addOption("dbinfo", "dbinfo", null, LOCALISER.msg(false, "014029"));
        cmd.addOption("schemainfo", "schemainfo", null, LOCALISER.msg(false, "014030"));
View Full Code Here

Examples of org.openqa.selenium.internal.CommandLine

    executeCommand(findReg(), args.toArray(new String[args.size()]));
  }

  private static String executeCommand(String commandName, String... args) {
    CommandLine cmd = new CommandLine(commandName, args);
    cmd.execute();

    String output = cmd.getStdOut();
    if (!cmd.isSuccessful()) {
      throw new WindowsRegistryException("exec return code " + cmd.getExitCode() + ": " + output);
    }
    return output;
  }
View Full Code Here

Examples of org.openqa.selenium.os.CommandLine

  @After
  public void afterEach() {
    driver.quit();

    // Make sure Opera is gone
    CommandLine line = new CommandLine("kill", "`pgrep opera`");
    line.execute();
  }
View Full Code Here

Examples of org.springframework.shell.CommandLine

    out.println("endif::[]");
    out.println("Below is a reference list of all Spring XD specific commands you can use in the link:Shell#interactive-shell[XD Shell].\n");


    GenericApplicationContext ctx = new GenericApplicationContext();
    ctx.getBeanFactory().registerSingleton("commandLine", new CommandLine(null, 100, null, false));
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(ctx);
    reader.loadBeanDefinitions("classpath*:META-INF/spring/spring-shell-plugin.xml");
    ctx.refresh();

    Comparator<Class<? extends CommandMarker>> comparator = new Comparator<Class<? extends CommandMarker>>() {
View Full Code Here

Examples of org.voltdb.utils.CommandLine

        } else {
            subroot = m_subRoots.get(0);
        }

        // Make the local Configuration object...
        CommandLine cmdln = (templateCmdLine.makeCopy());
        cmdln.setJavaProperty(clusterHostIdProperty, String.valueOf(hostId));
        if (this.m_additionalProcessEnv != null) {
            for (String name : this.m_additionalProcessEnv.keySet()) {
                cmdln.setJavaProperty(name, this.m_additionalProcessEnv.get(name));
            }
        }

        cmdln.internalPort(portGenerator.nextInternalPort());
        cmdln.voltFilePrefix(subroot.getPath());
        cmdln.internalPort(portGenerator.nextInternalPort());
        cmdln.port(portGenerator.nextClient());
        cmdln.adminPort(portGenerator.nextAdmin());
        cmdln.zkport(portGenerator.nextZkPort());
        cmdln.httpPort(portGenerator.nextHttp());
        // replication port and its two automatic followers.
        cmdln.drAgentStartPort(portGenerator.nextReplicationPort());
        portGenerator.nextReplicationPort();
        portGenerator.nextReplicationPort();
        if (m_target == BackendTarget.NATIVE_EE_VALGRIND_IPC) {
            EEProcess proc = m_eeProcs.get(0);
            assert(proc != null);
View Full Code Here

Examples of util.CommandLine

      Thread.sleep(50);
    }
  }

  public static Options parseCommandLine(String[] args) {
    CommandLine commandLine = new CommandLine(OPTION_DESCRIPTOR);
    if (commandLine.parse(args)) {
      boolean verbose = commandLine.hasOption("v");
      String interactionClassName = commandLine.getOptionArgument("i", "interactionClass");
      String portString = commandLine.getArgument("port");
      int port = (portString == null) ? 8099 : Integer.parseInt(portString);
      String statementTimeoutString = commandLine.getOptionArgument("s", "statementTimeout");
      Integer statementTimeout = (statementTimeoutString == null) ? null : Integer.parseInt(statementTimeoutString);
      boolean daemon = commandLine.hasOption("d");
      return new Options(verbose, port, getInteractionClass(interactionClassName), daemon, statementTimeout);
    }
    return null;
  }
View Full Code Here

Examples of xnap.cmdl.CommandLine

      if (jdkCheck)
    checkJDK(REQUIRED_CMDL_JDK);

      init();

      CommandLine cmdl = new CommandLine(argv);
      cmdl.run();
  }
  else {
      if (jdkCheck) {
    checkJDK(REQUIRED_GUI_JDK);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.