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)); }
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)); }