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