3 instantiations of Example
Microsoft.TemplateEngine.Cli (3)
Commands\Example.cs (3)
46return new Example(typedCommand, parentCommands.ToArray()); 59return new Example(siblingCommand, parentCommands2.ToArray()); 66return new Example(parseResult.CommandResult.Command, commandParts.ToArray());
75 references to Example
Microsoft.TemplateEngine.Cli (68)
Commands\BaseCommand.cs (5)
97Reporter.Output.WriteCommand(Example.For<InstantiateCommand>(args.ParseResult).WithArgument(InstantiateCommand.ShortNameArgument, usedCommandAlias)); 105var newCommandExample = Example.For<TNew>(parseResult); 113Example.For<TDepr>(parseResult), 117Reporter.Output.WriteCommand(Example.For<TNew>(parseResult).WithHelpOption().ToString().Yellow());
Commands\create\InstantiateCommand.cs (8)
473Example example = useInstantiateCommand 474? Example.For<InstantiateCommand>(instantiateArgs.ParseResult).WithArgument(ShortNameArgument, possibleMatch) 475: Example.For<NewCommand>(instantiateArgs.ParseResult).WithArgument(NewCommand.ShortNameArgument, possibleMatch); 501Example example = Example.For<NewCommand>(instantiateArgs.ParseResult).WithSubcommand(possibleMatch); 517Example 526Example 538Example
Commands\create\InstantiateCommand.Help.cs (2)
217Example 252writer.WriteLine(Example
Commands\create\InstantiateCommand.NoMatchHandling.cs (2)
154var example = Example
Commands\create\TemplateCommand.cs (1)
243reporter.WriteCommand(Example.FromExistingTokens(templateArgs.ParseResult).WithOption(SharedOptions.ForceOption));
Commands\Example.cs (9)
20public static implicit operator string(Example e) => e.ToString(); 27internal static Example For<T>(ParseResult parseResult) where T : Command 62internal static Example FromExistingTokens(ParseResult parseResult) 69internal Example WithOption(Option option, params string[] args) 91internal Example WithArgument(Argument argument, params string[] args) 107internal Example WithSubcommand(Command command) 119internal Example WithSubcommand(string token) 133internal Example WithSubcommand<T>() where T : Command 145internal Example WithHelpOption()
TemplateInvoker.cs (5)
240Reporter.Output.WriteCommand(Example.For<NewCommand>(templateArgs.ParseResult).WithOption(NewCommand.DebugRebuildCacheOption)); 256Reporter.Output.WriteCommand(Example.For<UninstallCommand>(templateArgs.ParseResult).WithArgument(BaseUninstallCommand.NameArgument, templatePackage.DisplayName)); 259Reporter.Output.WriteCommand(Example.For<InstallCommand>(templateArgs.ParseResult).WithArgument(BaseInstallCommand.NameArgument, templatePackage.DisplayName)); 269Example 292Reporter.Error.WriteCommand(Example.FromExistingTokens(templateArgs.ParseResult).WithOption(SharedOptions.ForceOption));
TemplateListCoordinator.cs (9)
77Example 122Example 130Example 152Reporter.Output.WriteLine(LocalizableStrings.TemplateInformationCoordinator_DotnetNew_Description, Example.For<NewCommand>(args.ParseResult)); 156Reporter.Output.WriteLine(LocalizableStrings.TemplateInformationCoordinator_DotnetNew_TemplatesHeader, Example.For<NewCommand>(args.ParseResult)); 165Example 173Example 181Example 187Example
TemplatePackageCoordinator.cs (12)
153Example 172Example 644Example 744Example 752Example 762Example 771Example 844Example 849Example 856Example 921Example 1007Reporter.Error.WriteCommand(Example.For<InstallCommand>(parseResult).WithArgument(BaseInstallCommand.NameArgument, packageToInstall).WithOption(BaseInstallCommand.ForceOption));
TemplatePackageDisplay.cs (10)
55Example 74Example 160_reporterError.WriteCommand(Example.For<InstallCommand>(parseResult).WithArgument(BaseInstallCommand.NameArgument, packageToInstall).WithOption(BaseInstallCommand.ForceOption)); 189_reporterError.WriteCommand(Example.For<InstallCommand>(parseResult).WithArgument(BaseInstallCommand.NameArgument, packageToInstall).WithOption(BaseInstallCommand.ForceOption)); 201_reporterError.WriteCommand(Example.For<UninstallCommand>(parseResult).WithArgument(BaseUninstallCommand.NameArgument, packageToInstall)); 202_reporterError.WriteCommand(Example.For<InstallCommand>(parseResult).WithArgument(BaseInstallCommand.NameArgument, packageToInstall).WithOption(BaseInstallCommand.ForceOption)); 267Example 303Example 308Example 315Example
TemplateSearch\CliTemplateSearchCoordinator.cs (5)
95Example 101Example 259Example 265Example 271Example
Microsoft.TemplateEngine.Cli.UnitTests (7)
ParserTests\InstallTests.cs (1)
238Assert.Equal("dotnet new install my-source", Example.For<NewCommand>(parseResult).WithSubcommand<InstallCommand>().WithArgument(BaseInstallCommand.NameArgument, "my-source"));
ParserTests\ListTests.cs (1)
278Assert.Equal("dotnet new list", Example.For<NewCommand>(parseResult).WithSubcommand<ListCommand>());
ParserTests\SearchTests.cs (3)
253Assert.Equal("dotnet new search my-template", Example.For<NewCommand>(parseResult).WithSubcommand<SearchCommand>().WithArgument(BaseSearchCommand.NameArgument, "my-template")); 267Assert.Equal("dotnet new search [<template-name>]", Example.For<NewCommand>(parseResult).WithSubcommand<SearchCommand>().WithArgument(BaseSearchCommand.NameArgument)); 281Assert.Equal("dotnet new search [<template-name>] --author Microsoft", Example.For<NewCommand>(parseResult).WithSubcommand<SearchCommand>().WithArgument(BaseSearchCommand.NameArgument).WithOption(SharedOptionsFactory.CreateAuthorOption(), "Microsoft"));
ParserTests\UninstallTests.cs (1)
99Assert.Equal("dotnet new uninstall my-source", Example.For<NewCommand>(parseResult).WithSubcommand<UninstallCommand>().WithArgument(BaseUninstallCommand.NameArgument, "my-source"));
ParserTests\UpdateTests.cs (1)
197Assert.Equal("dotnet new update", Example.For<NewCommand>(parseResult).WithSubcommand<UpdateCommand>());