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