Ejemplo n.º 1
0
        private NamedArgument <string> AddNamedArgument(string name, string valuePlaceholder, string description, Optional <IEnumerable <string> > allowedValues)
        {
            var namedArgument = new NamedArgument <string>(name, _)
            {
                AllowedValues = allowedValues
            };
            var namedHelp = new NamedHelp <string>(namedArgument)
            {
                ValuePlaceholder = valuePlaceholder,
                Description      = description
            };

            this.arguments.Add(namedArgument);
            this.help.Add(namedHelp);

            return(namedArgument);
        }
Ejemplo n.º 2
0
            public NamedArgumentComposer(
                string name,
                Action <T> callback,
                CommandLineParserConfigurator configurator,
                Action <Argument> addToArguments,
                Action <string, IArgumentWithName> addLongAlias,
                Action <IArgument> addToRequired,
                Action <Help.Help> addToHelp)
                : base(configurator)
            {
                this.addLongAlias  = addLongAlias;
                this.addToRequired = addToRequired;

                this.current = new NamedArgument <T>(name, callback);
                this.help    = new NamedHelp <T>(this.current);

                addToArguments(this.current);
                addToHelp(this.help);
            }