Examples of CommandLineParser


Examples of org.jampa.utils.CommandLineParser

   
    /*
     * User Home setting. This block must stay first, and no call to Log.getInstance() should
     * be made before the end of this block, as it will set the wrong path for Jampa's log file.
     */
    CommandLineParser parser = new CommandLineParser();
    parser.parse(Platform.getApplicationArgs());
   
    String userHome;
    if (parser.hasCustomDirectory()) {
      userHome = parser.getCustomDirectory();
    } else {
      userHome = System.getProperty("user.home"); //$NON-NLS-1$
    }
    setUserHome(userHome);
    /*
     * End of User Home setting.
     */
   
    if (parser.getCustomDirectoryErrorMessage() != null) {
      Log.getInstance(Application.class).warn(parser.getCustomDirectoryErrorMessage()); //$NON-NLS-1$
    }
   
    Log.getInstance(Application.class).info(Platform.getBundle(ID).getHeaders().get("Bundle-Name") + " version " + Platform.getBundle(ID).getHeaders().get("Bundle-Version") + " started."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    Log.getInstance(Application.class).info("Platform informations: " + Platform.getOSArch() + ", " + Platform.getOS() + ", " + Platform.getNL());     //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$     
   
    PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false);
    PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.DOCK_PERSPECTIVE_BAR, IWorkbenchPreferenceConstants.TOP_RIGHT);   
    PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.KEY_CONFIGURATION_ID, "Jampa.keySheme"); //$NON-NLS-1$
   
    Log.getInstance(Application.class).info("fileSeparator = " + SystemUtils.fileSeparator); //$NON-NLS-1$
    Log.getInstance(Application.class).info("userHome = " + SystemUtils.userHome); //$NON-NLS-1$
    Log.getInstance(Application.class).info("applicationDirectory = " + SystemUtils.applicationDirectory); //$NON-NLS-1$
    Log.getInstance(Application.class).info("playlistDirectory = " + SystemUtils.playlistDirectory); //$NON-NLS-1$
    Log.getInstance(Application.class).info("podcastDirectory = " + SystemUtils.podcastDirectory); //$NON-NLS-1$
    Log.getInstance(Application.class).info("currentDirectory = " + SystemUtils.currentDir); //$NON-NLS-1$
       
    if (parser.isPurgeDemanded()) {
      SystemUtils.purgeConfiguration();
    }
   
    SystemUtils.createConfiguration();   
   
View Full Code Here

Examples of org.jboss.aesh.cl.CommandLineParser

   @SuppressWarnings("unchecked")
   private CommandLineParser populate(UIWizard root, UIWizard current, String line, boolean lenient) throws Exception
   {
      addWizardStep(current);
      Map<String, InputComponent<?, Object>> inputs = getInputs();
      CommandLineParser parser = commandLineUtil.generateParser(root, inputs);
      CommandLine cmdLine = parser.parse(line, lenient, lenient);
      commandLineUtil.populateUIInputs(cmdLine, inputs);
      List<String> errors = validate();
      if (errors.isEmpty())
      {
         NavigationResult next = current.next(getContext());
View Full Code Here

Examples of org.jboss.aesh.cl.parser.CommandLineParser

      {
         throw new CommandNotFoundException(name);
      }
      try
      {
         CommandLineParser parser = cmd.getParser(shellContext, completeLine == null ? name : completeLine);
         CommandAdapter command = new CommandAdapter(shell, shellContext, cmd);
         return new ForgeCommandContainer(shellContext, parser, command);
      }
      catch (RuntimeException e)
      {
View Full Code Here

Examples of org.jitterbit.application.commandline.CommandLineParser

     *             if the command-line arguments are invalid.
     */
    public static void parseCommandLineArguments(String[] args) throws CommandLineParsingException {
        ApplicationLog.getMainLogger().info("ClientPlatform received command line arguments: " + Arrays.toString(args));
        if (args.length > 0) {
            CommandLineParser parser = (CommandLineParser) getAppContext().getBean("platform.CommandLineParser");
            parser.parse(args);
        }
    }
View Full Code Here

Examples of org.objectweb.celtix.tools.common.toolspec.parser.CommandLineParser

    }

    public String getUsage() {
        if (usage == null) {
            try {
                CommandLineParser parser = getCommandLineParser();

                if (parser != null) {
                    usage = parser.getUsage();
                }
            } catch (Exception ex) {
                usage = "Could not get usage for the tool";
            }
        }
View Full Code Here

Examples of org.objectweb.celtix.tools.common.toolspec.parser.CommandLineParser

        setMode(args);
        if (isQuietMode()) {
            redirectOutput();
        }
        if (toolspec != null) {
            parser = new CommandLineParser(toolspec);
            commandDoc = parser.parseArguments(args);
        }
    }
View Full Code Here

Examples of org.objectweb.celtix.tools.common.toolspec.parser.CommandLineParser

            checkParams(errors);
        }            
    }
   
    private void outputInfo() {
        CommandLineParser parser = getCommandLineParser();

        if (commandDocument.hasParameter("help")) {
            try {
                System.out.println(name + " " + getUsage());
                System.out.println();
                System.out.println("Options : ");
                System.out.println();
                System.out.println(parser.getDetailedUsage());
                String toolUsage = parser.getToolUsage();

                if (toolUsage != null) {
                    System.out.println(toolUsage);
                    System.out.println();
                }
View Full Code Here

Examples of org.openbp.common.commandline.CommandLineParser

    SyncModel processor = null;
    try
    {
      Application.setArguments(args);

      CommandLineParser cp = new CommandLineParser();
      cp
        .setUsageMsgHeader(new String[]
        {
          "Model synchronization utility.",
          "Copies model data between different model manager types",
          "", "Usage:",
        });

      cp.addArgumentOption("SourceMgr", "Source model manager (classpath|filesystem|database) (default: filesystem)");
      cp.addArgumentOption("TargetMgr", "Target model manager (filesystem|database) (default: database)");
      cp.addArgumentOption("Mode", "Operation mode (Copy|CopyAll|Remove|RemoveAll) (default: copy)");
      cp.addBooleanOption("Overwrite", "Forces existing models that exist in the target manager to be removed before the copy operation takes place (default: false)");

      try
      {
        cp.parse(args);
      }
      catch (CommandLineParserException e)
      {
        System.err.println(e.getMessage());
        cp.printUsageAndExit();
      }

      processor = new SyncModel();
      processor.setProcessServer(new ProcessServerFactory().createProcessServer("OpenBP-SyncModel-Hibernate.spring.xml"));

      int mode = 0;
      String m = cp.getStringOption("Mode");
      if (m.equalsIgnoreCase("Copy"))
      {
        mode = MODE_COPY;
      }
      else if (m.equalsIgnoreCase("CopyAll"))
      {
        mode = MODE_COPY_ALL;
      }
      else if (m.equalsIgnoreCase("Remove"))
      {
        mode = MODE_REMOVE;
      }
      else if (m.equalsIgnoreCase("RemoveAll"))
      {
        mode = MODE_REMOVE_ALL;
      }
      else
      {
        printError("Unknown operation mode '" + m + "'.");
      }
      processor.setMode(mode);

      String sourceMgrType = cp.getStringOption("SourceMgr");
      if (sourceMgrType == null)
        sourceMgrType = "filesystem";
      processor.setSourceMgrType(sourceMgrType);
      String targetMgrType = cp.getStringOption("TargetMgr");
      if (targetMgrType == null)
        targetMgrType = "database";
      processor.setTargetMgrType(targetMgrType);
      processor.setOverwrite(cp.getBooleanOption("Overwrite"));

      boolean hasArguments = false;
      String [] modelNames = cp.getArguments();
      if (modelNames != null)
      {
        for (int i = 0; i < modelNames.length; ++i)
        {
          processor.addModel(modelNames[i]);
View Full Code Here

Examples of org.openstreetmap.osmosis.core.cli.CommandLineParser

   *
   * @param args
   *            The command line arguments.
   */
  public static void run(String[] args) {
    CommandLineParser commandLineParser;
    TaskRegistrar taskRegistrar;
    Pipeline pipeline;
    long startTime;
    long finishTime;
   
    startTime = System.currentTimeMillis();
   
    configureLoggingConsole();
   
    commandLineParser = new CommandLineParser();
   
    // Parse the command line arguments into a consumable form.
    commandLineParser.parse(args);
   
    // Configure the new logging level.
    configureLoggingLevel(commandLineParser.getLogLevelIndex());
   
    LOG.info("Osmosis Version " + OsmosisConstants.VERSION);
    taskRegistrar = new TaskRegistrar();
    taskRegistrar.initialize(commandLineParser.getPlugins());
   
    pipeline = new Pipeline(taskRegistrar.getFactoryRegister());
   
    LOG.info("Preparing pipeline.");
    pipeline.prepare(commandLineParser.getTaskInfoList());
   
    LOG.info("Launching pipeline execution.");
    pipeline.execute();
   
    LOG.info("Pipeline executing, waiting for completion.");
View Full Code Here

Examples of stallone.util.CommandLineParser

        return res;
    }

    public static CommandLineParser parseArguments(String[] args)
    {
        CommandLineParser parser = new CommandLineParser();

        // input
        parser.addStringArrayCommand("i", true);

        parser.addCommand("columns", true);
        parser.addIntArgument("columns", true);
        parser.addIntArgument("columns", true);
        parser.addIntArgument("columns", true);

        parser.addIntCommand("maxtime", true);
        parser.addDoubleCommand("lagmult", true);

        parser.addIntCommand("samplingtime", true);

        parser.addDoubleCommand("windowfraction", true);

        parser.addCommand("subtractmean", true);

        // parse
        if (!parser.parse(args))
        {
            throw (new IllegalArgumentException("Parsing error!"));
        }

        return parser;
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.