示例#1
0
 /**
  * Start a buidler for a sublist of args
  *
  * @param quoted true if the list should be quoted
  * @return a builder for a sublist
  */
 public Builder subList(boolean quoted) {
   Builder subbuild = new Builder();
   ArgListBuilder arg = new ArgListBuilder(subbuild);
   arg.setQuoted(quoted);
   argList.addArg(arg);
   subbuild.parent = this;
   return subbuild;
 }
示例#2
0
  private static ArrayList<String> buildCommandForNode(
      ExecArgList command, Map<String, Map<String, String>> dataContext, String osFamily) {
    final Converter<String, String> quote = CLIUtils.argumentQuoteForOperatingSystem(osFamily);
    final Converter<String, String> expand =
        DataContextUtils.replaceDataReferencesConverter(
            dataContext, DataContextUtils.replaceMissingOptionsWithBlank, false);

    final ArrayList<String> commandList = new ArrayList<String>();
    CommandVisitor visiter = new CommandVisitor(commandList, quote, expand);
    command.visitWith(visiter);
    return commandList;
  }
示例#3
0
 /**
  * Add a list of args
  *
  * @param args args
  * @param quoted true if all should be quoted
  * @return builder
  */
 public Builder args(String[] args, boolean quoted) {
   argList.addArgs(Arrays.asList(args), quoted);
   return this;
 }
示例#4
0
 /**
  * Add a list of args
  *
  * @param args args
  * @param quoted true if all should be quoted
  * @return builder
  */
 public Builder args(List<String> args, Predicate quoted) {
   for (String arg : args) {
     argList.addArg(arg, quoted.evaluate(arg));
   }
   return this;
 }
示例#5
0
 /**
  * Add a list of args
  *
  * @param args args
  * @param quoted true if all should be quoted
  * @return builder
  */
 public Builder args(List<String> args, boolean quoted) {
   argList.addArgs(args, quoted);
   return this;
 }
示例#6
0
 /**
  * Add a string arg
  *
  * @param arg argument
  * @param quoted true if it needs to be quoted
  * @return builder
  */
 public Builder arg(String arg, boolean quoted) {
   argList.addArg(arg, quoted);
   return this;
 }