Examples of CommandLine


Examples of bear.plugins.sh.CommandLine

        @Override
        public Dependency asInstalledDependency() {
            final Dependency dep = new Dependency($(toolDistrName) + " installation", $);

            CommandLine line = $.sys.line();
            Optional<JavaPlugin> java = global.getPlugin(JavaPlugin.class);

            if (java.isPresent()) {
                try {
                    line.setVar("JAVA_HOME", $(java.get().homePath));
                } catch (Fun.UndefinedException e) {
                    LoggerFactory.getLogger("log").debug("ignoring JAVA_HOME as the version is not set");
                }
            }

            line.addRaw(createVersionCommandLine());

            dep.add(dep.new Command(
                line,
                new Predicate<CharSequence>() {
                    @Override
View Full Code Here

Examples of com.alibaba.antx.util.cli.CommandLine

        options.addOption(builder.withLongOpt("type").hasArg().withDescription("�ļ����ͣ����磺war, jar, ear��").create(
                OPT_TYPE));
    }

    public CommandLine parse(String[] args) {
        CommandLine cli;

        try {
            cli = new PosixParser().parse(options, args);
        } catch (ParseException e) {
            throw new CLIException(e);
View Full Code Here

Examples of com.atolsystems.atolutilities.CommandLine

                }
            }

            start = System.nanoTime();
            if(!useOldCommandLineStyle){
                CommandLine cl = new CommandLine(args);
                System.out.println("command line after arg file expansion:");
                System.out.println(cl);
                cl.removeProcessed();
                System.out.println("Command line after clean up:");
                System.out.println(cl);

                cl.addArgDefs(t.getArgDefs());

                boolean argsRemain;
                try{
                    do {
                        argsRemain = cl.processArg(true);
                    } while (argsRemain);
                    //Configuration check after first pass through command line
                    if (false == cl.isAllArgsRecognized()) {
                        throw new InvalidCommandLineException("Not all arguments were recognized:\n" + cl.toString());
                    }
                } catch (InvalidCommandLineException ex){
                    throw new InvalidCommandLineException("Argument "+cl.getCurArgIndex()+" is not valid\n"+
                            "Command line dump:\n"+cl.toString(),ex);
                }catch (Throwable ex){
                    throw new RuntimeException("Error happened during evaluation of argument "+cl.getCurArgIndex()+
                            "\nCommand line dump:\n"+cl.toString(),ex);
                }

                cl.setCurArgIndex(-1);

                int execOut = t.execute(terminal);

                do{
                    argsRemain=cl.processArg(false);
                }while(argsRemain);
                if(cl.isAllArgsProcessed()){
                    terminal.logLine(ScardLogHandler.LOG_INFO,"INFO: All command line arguments processed.");
                }else{
                    throw new InvalidCommandLineException("Not all command line arguments have been processed.\n"+cl.toString());
                }
            }else{
                oldStyleCommandLine.processArgs();
                int execOut = t.execute(terminal);
            }
View Full Code Here

Examples of com.dbxml.db.client.tools.CommandLine

         while ( server == null || !server.isRunning() );

         psOut.println("Running Bootstrap Script");

         // Execute The Bootstrap Script
         CommandLine cl = new CommandLine();
         cl.setClient(new dbXMLClientImpl());

         cl.setProperty(CommandLine.TOTALS, Boolean.FALSE);
         cl.setProperty(CommandLine.DURATIONS, Boolean.FALSE);
         cl.setProperty(CommandLine.CONFIRM, Boolean.FALSE);
         cl.setProperty(CommandLine.INTERACTIVE, Boolean.FALSE);

         cl.setWriter(new OutputStreamWriter(psOut, "UTF8"));
         cl.setErrorWriter(new OutputStreamWriter(psErr, "UTF8"));

         FileInputStream fis = new FileInputStream("install/create-db.dbxml");
         BufferedInputStream bis = new BufferedInputStream(fis, 4096);
         InputStreamReader isr = new InputStreamReader(bis, "UTF8");
         cl.setReader(isr);
         cl.process();

         psOut.println("Bootstrap Complete");
         server.shutDown(0);
      }
      catch ( Exception e ) {
View Full Code Here

Examples of com.facebook.presto.hive.shaded.org.apache.commons.cli.CommandLine

  public static void main(String[] args) {
    HiveMetaTool metaTool = new HiveMetaTool();
    metaTool.init();
    CommandLineParser parser = new GnuParser();
    CommandLine line = null;

    try {
      try {
        line = parser.parse(metaTool.cmdLineOptions, args);
      } catch (ParseException e) {
        System.err.println("HiveMetaTool:Parsing failed.  Reason: " + e.getLocalizedMessage());
        printAndExit(metaTool);
      }

      if (line.hasOption("help")) {
        HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp("metatool", metaTool.cmdLineOptions);
      } else if (line.hasOption("listFSRoot")) {
        if (line.hasOption("dryRun")) {
          System.err.println("HiveMetaTool: dryRun is not valid with listFSRoot");
          printAndExit(metaTool);
        } else if (line.hasOption("serdePropKey")) {
          System.err.println("HiveMetaTool: serdePropKey is not valid with listFSRoot");
          printAndExit(metaTool);
        } else if (line.hasOption("tablePropKey")) {
          System.err.println("HiveMetaTool: tablePropKey is not valid with listFSRoot");
          printAndExit(metaTool);
        }
        metaTool.listFSRoot();
      } else if (line.hasOption("executeJDOQL")) {
        String query = line.getOptionValue("executeJDOQL");
        if (line.hasOption("dryRun")) {
          System.err.println("HiveMetaTool: dryRun is not valid with executeJDOQL");
          printAndExit(metaTool);
        } else if (line.hasOption("serdePropKey")) {
          System.err.println("HiveMetaTool: serdePropKey is not valid with executeJDOQL");
          printAndExit(metaTool);
        } else if (line.hasOption("tablePropKey")) {
          System.err.println("HiveMetaTool: tablePropKey is not valid with executeJDOQL");
          printAndExit(metaTool);
        }
        if (query.toLowerCase().trim().startsWith("select")) {
          metaTool.executeJDOQLSelect(query);
        } else if (query.toLowerCase().trim().startsWith("update")) {
          metaTool.executeJDOQLUpdate(query);
        } else {
          System.err.println("HiveMetaTool:Unsupported statement type");
          printAndExit(metaTool);
        }
      } else if (line.hasOption("updateLocation")) {
        String[] loc = line.getOptionValues("updateLocation");
        boolean isDryRun = false;
        String serdepropKey = null;
        String tablePropKey = null;

        if (loc.length != 2 && loc.length != 3) {
          System.err.println("HiveMetaTool:updateLocation takes in 2 required and 1 " +
              "optional arguments but " +
              "was passed " + loc.length + " arguments");
          printAndExit(metaTool);
        }

        Path newPath = new Path(loc[0]);
        Path oldPath = new Path(loc[1]);

        URI oldURI = oldPath.toUri();
        URI newURI = newPath.toUri();

        if (line.hasOption("dryRun")) {
          isDryRun = true;
        }

        if (line.hasOption("serdePropKey")) {
          serdepropKey = line.getOptionValue("serdePropKey");
        }

        if (line.hasOption("tablePropKey")) {
          tablePropKey = line.getOptionValue("tablePropKey");
        }

        /*
         * validate input - Both new and old URI should contain valid host names and valid schemes.
         * port is optional in both the URIs since HDFS HA NN URI doesn't have a port.
         */
          if (oldURI.getHost() == null || newURI.getHost() == null) {
            System.err.println("HiveMetaTool:A valid host is required in both old-loc and new-loc");
          } else if (oldURI.getScheme() == null || newURI.getScheme() == null) {
            System.err.println("HiveMetaTool:A valid scheme is required in both old-loc and new-loc");
          } else {
            metaTool.updateFSRootLocation(oldURI, newURI, serdepropKey, tablePropKey, isDryRun);
          }
        } else {
          if (line.hasOption("dryRun")) {
            System.err.println("HiveMetaTool: dryRun is not a valid standalone option");
          } else if (line.hasOption("serdePropKey")) {
            System.err.println("HiveMetaTool: serdePropKey is not a valid standalone option");
          } else if (line.hasOption("tablePropKey")) {
            System.err.println("HiveMetaTool: tablePropKey is not a valid standalone option");
            printAndExit(metaTool);
          } else {
            System.err.print("HiveMetaTool:Parsing failed.  Reason: Invalid arguments: " );
            for (String s : line.getArgs()) {
              System.err.print(s + " ");
            }
            System.err.println();
          }
          printAndExit(metaTool);
View Full Code Here

Examples of com.vividsolutions.jtstest.command.CommandLine

    }
  }


  private static void parseCommandLine(String[] args) throws ParseException {
    commandLine = new CommandLine('-');
    OptionSpec os;

    os = new OptionSpec("files", OptionSpec.NARGS_ONE_OR_MORE);
    commandLine.addOptionSpec(os);
View Full Code Here

Examples of net.sourceforge.cruisecontrol.util.Commandline

     * @return the list of modifications, or an empty list if we failed
     * to retrieve the changes.
     */
    public List getModifications(Date lastBuild, Date now) {
        List modifications = new ArrayList();
        Commandline command;
        try {
            command = buildHistoryCommand(lastBuild, now);
        } catch (CruiseControlException e) {
            LOG.error("Error building history command", e);
            return modifications;
View Full Code Here

Examples of org.apache.commons.cli.CommandLine

      int i = 0;
      for (Iterator iter = arguments.iterator(); iter.hasNext();) {
        String arg = (String) iter.next();
        args[i++] = arg;
      }
      CommandLine line = parser.parse(getOptions(), args);
      execute( commandName, console, line );
    } catch (ParseException e)
    {
      console.out.println(">> Invalid arguments: " + e.getMessage());     
//      printHelp(commandName, console.out);
View Full Code Here

Examples of org.apache.commons.cli.CommandLine

    OptionBuilder.withDescription("Run <uis>. ',' separated list of user interfaces to run. The first one given will respond to requests without determinable source UI (e.g. further torrents added via command line).");
    OptionBuilder.withArgName("uis");
    OptionBuilder.hasArg();
    options.addOption(OptionBuilder.create('u'));
   
    CommandLine commands = null;
    try {
      commands = parser.parse(options, args, true);
    } catch( ParseException exp ) {
      Logger.getLogger("azureus2").error("Parsing failed.  Reason: " + exp.getMessage(), exp);
      if (constart)
        System.exit(2);
    }
    if (commands.hasOption('h')) {
      if (constart) {
        HelpFormatter hf = new HelpFormatter();
        hf.printHelp("java org.gudy.azureus2.ui.common.Main", "Optionally you can put torrent files to add to the end of the command line.\r\n", options, "Available User Interfaces: swt (default), web, console\r\nThe default interface is not started if you give either the '-e' or '-c' option (But you can start it by hand with '-u').", true);
        System.exit(0);
      }
View Full Code Here

Examples of org.apache.commons.cli.CommandLine

    boolean mi = mi_str != null && mi_str.equalsIgnoreCase("true");

    initRootLogger();
   
    try{
         CommandLine commands = parseCommands(args, true);

         if ( commands != null && directLaunch( args, commands )){
          
           return;
         }
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.