12 instantiations of Example
Microsoft.TemplateEngine.Cli (12)
Commands\Example.cs (12)
31return new Example<T>(typedCommand, [.. parentCommands]); 44return new Example<T>(siblingCommand, [.. parentCommands2]); 79return new Example<T>((T)parseResult.CommandResult.Command, [.. commandParts]); 102return new(currentCommand, commandParts.Add(option.Name).AddRange(args.Select(a => a.Any(char.IsWhiteSpace) ? $"'{a}'" : a))); 107return new(currentCommand, commandParts.Add(option.Name)); 110return new(currentCommand, commandParts.AddRange(option.Name, CommandLineUtils.FormatArgumentUsage(option))); 117=> new(currentCommand, commandParts.Add(Constants.KnownHelpAliases.First())); 120=> new(currentCommand, commandParts.AddRange(args.Select(a => a.Any(char.IsWhiteSpace) ? $"'{a}'" : a))); 123=> new(currentCommand, commandParts.Add(CommandLineUtils.FormatArgumentUsage(argumentSelector(currentCommand)))); 129return new(subcommand, commandParts.Add(subcommand.Name)); 137return new(subcommand, commandParts.Add(subcommand.Name)); 145return new(subcommand, commandParts.Add(token));
12 references to Example
Microsoft.TemplateEngine.Cli (12)
Commands\BaseCommand.cs (2)
129var example = Example.For<InstantiateCommand>(args.ParseResult).WithArguments(usedCommandAlias); 139var newCommandExample = Example.For<TNewCommand>(parseResult);
Commands\create\InstantiateCommand.NoMatchHandling.cs (1)
155var example = Example
Commands\Example.cs (9)
12internal static Example<T> For<T>(ParseResult parseResult) where T : Command 75internal static Example<T> FromExistingTokens<T>(ParseResult parseResult) where T : Command 96internal Example<T> WithOption(Func<T, Option> optionSelector, params string[] args) 116public new Example<T> WithHelpOption() 119public Example<T> WithArguments(params IEnumerable<string> args) 122public Example<T> WithArgument(Func<T, Argument> argumentSelector) 125public Example<TSubcommand> WithSubcommand<TSubcommand>(Func<T, TSubcommand> subcommandSelector) 132public Example<TSubcommand> WithSubcommand<TSubcommand>() where TSubcommand : Command 140internal Example<Command> WithSubcommand(string token)