Examples of CommandLineArgument


Examples of com.github.maven_nar.cpptasks.types.CommandLineArgument

        int warnings = specificDef.getWarnings(defaultProviders, 0);
        addWarningSwitch(args, warnings);
        Enumeration<CommandLineArgument> argEnum = cmdArgs.elements();
        int endCount = 0;
        while (argEnum.hasMoreElements()) {
            CommandLineArgument arg = argEnum.nextElement();
            switch (arg.getLocation()) {
                case 1 :
                    args.addElement(arg.getValue());
                    break;
                case 2 :
                    endCount++;
                    break;
            }
        }
        String[] endArgs = new String[endCount];
        argEnum = cmdArgs.elements();
        int index = 0;
        while (argEnum.hasMoreElements()) {
            CommandLineArgument arg = (CommandLineArgument) argEnum
                    .nextElement();
            if (arg.getLocation() == 2) {
                endArgs[index++] = arg.getValue();
            }
        }
        //
        //   Want to have distinct set of arguments with relative
        //      path names for includes that are used to build
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.CommandLineArgument

            return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
                    "ProcessorDef")).getActiveProcessorArgs();
        }
        Vector activeArgs = new Vector(processorArgs.size());
        for (int i = 0; i < processorArgs.size(); i++) {
            CommandLineArgument arg = (CommandLineArgument) processorArgs
                    .elementAt(i);
            if (arg.isActive(p)) {
                activeArgs.addElement(arg);
            }
        }
        CommandLineArgument[] array = new CommandLineArgument[activeArgs.size()];
        activeArgs.copyInto(array);
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.CommandLineArgument

            return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
                    "ProcessorDef")).getActiveProcessorArgs();
        }
        Vector activeArgs = new Vector(processorArgs.size());
        for (int i = 0; i < processorArgs.size(); i++) {
            CommandLineArgument arg = (CommandLineArgument) processorArgs
                    .elementAt(i);
            if (arg.isActive(p)) {
                activeArgs.addElement(arg);
            }
        }
        CommandLineArgument[] array = new CommandLineArgument[activeArgs.size()];
        activeArgs.copyInto(array);
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.CommandLineArgument

        int warnings = specificDef.getWarnings(defaultProviders, 0);
        addWarningSwitch(args, warnings);
        Enumeration argEnum = cmdArgs.elements();
        int endCount = 0;
        while (argEnum.hasMoreElements()) {
            CommandLineArgument arg = (CommandLineArgument) argEnum
                    .nextElement();
            switch (arg.getLocation()) {
                case 1 :
                    args.addElement(arg.getValue());
                    break;
                case 2 :
                    endCount++;
                    break;
            }
        }
        String[] endArgs = new String[endCount];
        argEnum = cmdArgs.elements();
        int index = 0;
        while (argEnum.hasMoreElements()) {
            CommandLineArgument arg = (CommandLineArgument) argEnum
                    .nextElement();
            if (arg.getLocation() == 2) {
                endArgs[index++] = arg.getValue();
            }
        }
        //
        //   Want to have distinct set of arguments with relative
        //      path names for includes that are used to build
View Full Code Here

Examples of net.sf.antcontrib.cpptasks.types.CommandLineArgument

            return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
                    "ProcessorDef")).getActiveProcessorArgs();
        }
        Vector activeArgs = new Vector(processorArgs.size());
        for (int i = 0; i < processorArgs.size(); i++) {
            CommandLineArgument arg = (CommandLineArgument) processorArgs
                    .elementAt(i);
            if (arg.isActive(p)) {
                activeArgs.addElement(arg);
            }
        }
        CommandLineArgument[] array = new CommandLineArgument[activeArgs.size()];
        activeArgs.copyInto(array);
View Full Code Here

Examples of net.sf.antcontrib.cpptasks.types.CommandLineArgument

        int warnings = specificDef.getWarnings(defaultProviders, 0);
        addWarningSwitch(args, warnings);
        Enumeration argEnum = cmdArgs.elements();
        int endCount = 0;
        while (argEnum.hasMoreElements()) {
            CommandLineArgument arg = (CommandLineArgument) argEnum
                    .nextElement();
            switch (arg.getLocation()) {
                case 1 :
                    args.addElement(arg.getValue());
                    break;
                case 2 :
                    endCount++;
                    break;
            }
        }
        String[] endArgs = new String[endCount];
        argEnum = cmdArgs.elements();
        int index = 0;
        while (argEnum.hasMoreElements()) {
            CommandLineArgument arg = (CommandLineArgument) argEnum
                    .nextElement();
            if (arg.getLocation() == 2) {
                endArgs[index++] = arg.getValue();
            }
        }
        //
        //   Want to have distinct set of arguments with relative
        //      path names for includes that are used to build
View Full Code Here

Examples of org.parosproxy.paros.extension.CommandLineArgument

        System.out.println("Scanner completed.");

    }

    private CommandLineArgument[] getCommandLineArguments() {
        arguments[ARG_SCAN_IDX] = new CommandLineArgument("-scan", 0, null, "", "-scan : Run vulnerability scan depending on previously saved policy.");
        return arguments;
    }
View Full Code Here

Examples of org.parosproxy.paros.extension.CommandLineArgument

         
    }

  public void parse(Vector commandList) throws Exception {
      this.commandList = commandList;
      CommandLineArgument lastArg = null;
      boolean found = false;
      int remainingValueCount = 0;
     
      for (int i=0; i<args.length; i++) {
          if (args[i] == null) continue;
          found = false;
         
        for (int j=0; j<commandList.size() && !found; j++) {
            CommandLineArgument[] extArg = (CommandLineArgument[]) commandList.get(j);
            for (int k=0; k<extArg.length && !found; k++)
            if (args[i].compareToIgnoreCase(extArg[k].getName()) == 0) {
               
                // check if previous keyword satisfied its required no. of parameters
                if (remainingValueCount > 0) {
                  throw new Exception("Missing parameters for keyword '" + lastArg.getName() + "'.");
                }
               
                // process this keyword
                lastArg = extArg[k];
                lastArg.setEnabled(true);
                found = true;
                args[i] = null;
                remainingValueCount = lastArg.getNumOfArguments();
            }
        }


        // check if current string is a keyword preceded by '-'
        if (args[i] != null && args[i].startsWith("-")) {
            continue;
        }

        // check if there is no more expected param value
        if (lastArg != null && remainingValueCount == 0) {
            continue;
        }
       
        // check if consume remaining for last matched keywords
        if (!found && lastArg != null) {               
            if (lastArg.getPattern() == null || lastArg.getPattern().matcher(args[i]).find()) {
                lastArg.getArguments().add(args[i]);
                if (remainingValueCount > 0) {
                    remainingValueCount--;
                }
                args[i] = null;
            } else {
                throw new Exception(lastArg.getErrorMessage());
            }
        }
       
      }

      // check if the last keyword satified its no. of parameters.
      if (lastArg != null && remainingValueCount > 0) {
            throw new Exception("Missing parameters for keyword '" + lastArg.getName() + "'.");
        }
     
      // check if there is some unknown keywords
      for (int i=0; i<args.length; i++) {
          if (args[i] != null) {
View Full Code Here

Examples of org.parosproxy.paros.extension.CommandLineArgument

        System.out.println("Spider completed.");

    }

    private CommandLineArgument[] getCommandLineArguments() {
        arguments[ARG_SPIDER_IDX] = new CommandLineArgument("-spider", 0, null, "", "-spider : run spider.  See other parameters");
        arguments[ARG_URL_IDX] = new CommandLineArgument("-seed", -1, "https{0,1}://\\S+", "Seed should be a URL", "-seed {URL1} {URL2} ... : Add seeds to the spider for crawling.");
        return arguments;
    }
View Full Code Here

Examples of org.parosproxy.paros.extension.CommandLineArgument

     * @see org.parosproxy.paros.extension.CommandLineListener#execute(org.parosproxy.paros.extension.CommandLineArgument[])
     */
    public void execute(CommandLineArgument[] args) {

        if (arguments[ARG_LAST_SCAN_REPORT_IDX].isEnabled()) {
        CommandLineArgument arg = arguments[ARG_LAST_SCAN_REPORT_IDX];
            ReportLastScan report = new ReportLastScan();
            String fileName = (String) arg.getArguments().get(0);
            try {
                report.generate(fileName, getModel());
                System.out.println("Last Scan Report generated at " + fileName);
            } catch (Exception e) {
               
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.