public SimpleApplicationParametersModel(AbstractOptionParser parser, String valuesModelName, OptionModel helpOption, OptionModel optionAndValueSeparator, OptionModel[] options, Int32 minValues, params String[] optionsWithDuplicatesAllowed) : base( parser, new ApplicationParameterModel("Options", false, ApplicationParameterModel.MAX_UNLIMITED, options.Concat(new[] { helpOption }).ToArray()), optionAndValueSeparator == null ? null : new ApplicationParameterModel(optionAndValueSeparator.PrimaryName, false, 1, 1, optionAndValueSeparator), new ApplicationParameterModel(valuesModelName, true, Math.Max(1, minValues), ApplicationParameterModel.MAX_UNLIMITED)) { this._optionsWithDuplicates = new ReadOnlyCollection <String>(optionsWithDuplicatesAllowed.FilterNulls()); this._helpOption = helpOption; }
private static IList <String> TryExpandArgumentsRecursively(AbstractOptionParser parser, String arg) { List <String> result = null; var array = parser.TryExpandArgument(arg); if (array != null) { result = new List <String>(array); foreach (var str in array) { var list = TryExpandArgumentsRecursively(parser, str); if (list != null) { result.AddRange(list); } } } return(result); }
public SimpleApplicationParametersModel(AbstractOptionParser parser, String valuesModelName, OptionModel helpOption, OptionModel optionAndValueSeparator, OptionModel[] options, params String[] optionsWithDuplicatesAllowed) : this(parser, valuesModelName, helpOption, optionAndValueSeparator, options, 1, optionsWithDuplicatesAllowed) { }
public ApplicationParametersModel(AbstractOptionParser parser, params ApplicationParameterModel[] parameters) { this._parser = parser ?? DEFAULT_PARSER; this._parameters = new ReadOnlyCollection <ApplicationParameterModel>(parameters.FilterNulls()); }