Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see
 /// cref="RequiredArgumentOptionImpl"/> class.
 /// </summary>
 /// <param name="supplier">
 /// The function returns the string representing this option, which is
 /// actually specified with the command line.
 /// </param>
 /// <param name="spec">
 /// The specification of the option.
 /// </param>
 /// <param name="schema">
 /// The schema of the option.
 /// </param>
 /// <param name="values">
 /// The argument values of the option.
 /// </param>
 /// <seealso cref="OptionSchema.Add(string, char?, string, string,
 /// Action{RequiredArgumentOption})"/>
 public RequiredArgumentOptionImpl(
     Func <string> supplier,
     RequiredArgumentOptionSpec spec,
     OptionSchema schema,
     IEnumerable <string> values)
     : base(supplier)
 {
     Spec           = spec;
     Schema         = schema;
     ArgumentValues = values.ToImmutableArray();
 }
Exemple #2
0
        /// <inheritdoc/>
        public OptionSchema Add(
            string name,
            char?shortName,
            string argumentName,
            string description,
            Action <RequiredArgumentOption> action)
        {
            CheckName(name);
            CheckShortName(shortName);
            CheckDuplication(name, shortName);
            var spec = new RequiredArgumentOptionSpec(
                name, shortName, argumentName, description, action);

            return(new OptionSchemaImpl(all.Append(spec)));
        }