4 writes to _currentCommand
Microsoft.TemplateEngine.Cli (4)
Commands\Example.cs (4)
17
_currentCommand
= currentCommand;
115
_currentCommand
= command;
129
_currentCommand
= commandToUse;
139
_currentCommand
= _currentCommand.Subcommands.First(c => c is T);
13 references to _currentCommand
Microsoft.TemplateEngine.Cli (13)
Commands\Example.cs (13)
71
if (!
_currentCommand
.Options.Contains(option) && !
_currentCommand
.Options.Any(o => o.Name == option.Name))
73
throw new ArgumentException($"Command {
_currentCommand
.Name} does not have option {option.Name}");
93
if (!
_currentCommand
.Arguments.Contains(argument))
95
throw new ArgumentException($"Command {
_currentCommand
.Name} does not have argument {argument.Name}");
109
if (!
_currentCommand
.Subcommands.Contains(command))
111
throw new ArgumentException($"Command {
_currentCommand
.Name} does not have subcommand {command.Name}");
121
Command? commandToUse =
_currentCommand
.Subcommands.FirstOrDefault(c => c.Name.Equals(token) || c.Aliases.Contains(token));
125
throw new ArgumentException($"Command {
_currentCommand
.Name} does not have subcommand '{token}'.");
135
if (!
_currentCommand
.Subcommands.Any(c => c is T))
137
throw new ArgumentException($"Command {
_currentCommand
.Name} does not have subcommand {typeof(T).Name}");
139
_currentCommand =
_currentCommand
.Subcommands.First(c => c is T);
140
_commandParts.Add(
_currentCommand
.Name);