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)
71if (!_currentCommand.Options.Contains(option) && !_currentCommand.Options.Any(o => o.Name == option.Name)) 73throw new ArgumentException($"Command {_currentCommand.Name} does not have option {option.Name}"); 93if (!_currentCommand.Arguments.Contains(argument)) 95throw new ArgumentException($"Command {_currentCommand.Name} does not have argument {argument.Name}"); 109if (!_currentCommand.Subcommands.Contains(command)) 111throw new ArgumentException($"Command {_currentCommand.Name} does not have subcommand {command.Name}"); 121Command? commandToUse = _currentCommand.Subcommands.FirstOrDefault(c => c.Name.Equals(token) || c.Aliases.Contains(token)); 125throw new ArgumentException($"Command {_currentCommand.Name} does not have subcommand '{token}'."); 135if (!_currentCommand.Subcommands.Any(c => c is T)) 137throw 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);