Exemple #1
0
        public static CommandsHelp Create(
            IEnumerable <Command> commands,
            IEnumerable <OptionValueProvider> providers = null,
            Filter filter = null)
        {
            ImmutableArray <CommandItem> commandsHelp = HelpProvider.GetCommandItems(commands, filter);

            ImmutableArray <OptionValueList> values = HelpProvider.GetOptionValues(
                commands.SelectMany(f => f.Options),
                providers ?? ImmutableArray <OptionValueProvider> .Empty,
                filter);

            return(new CommandsHelp(commandsHelp, values));
        }
Exemple #2
0
        public static CommandHelp Create(
            Command command,
            IEnumerable <OptionValueProvider> providers = null,
            Filter filter = null)
        {
            ImmutableArray <ArgumentItem> arguments = (command.Arguments.Any())
                ? HelpProvider.GetArgumentItems(command.Arguments, filter)
                : ImmutableArray <ArgumentItem> .Empty;

            ImmutableArray <OptionItem> options = HelpProvider.GetOptionItems(command.Options, filter);

            ImmutableArray <OptionValueList> values = HelpProvider.GetOptionValues(
                command.Options,
                providers ?? ImmutableArray <OptionValueProvider> .Empty,
                filter);

            return(new CommandHelp(command, arguments, options, values));
        }