Example #1
0
        /// <summary>
        /// Add a command to manager.
        /// Throws <see cref="ArgumentException"/> when a command with same prefix exists.
        /// </summary>
        /// <param name="command">the command</param>
        /// <exception cref="ArgumentException"/>
        public void RegisterCommand(ICmdLine command)
        {
            if (commands.Any(x => x.Prefix == command.Prefix))
            {
                throw new ArgumentException($@"A commandline with prefix ""{ command.Prefix }"" already exists.", nameof(command));
            }

            commands.Add(command);
        }
Example #2
0
 public SolutionRunner(ICmdLine cmdLine, IHelpDisplay helpDisplay, IFileSystem fileSystem, IMSBuild msBuild, ILogger logger, IProcessRunner processRunner, INuGet nuGet)
 {
     _cmdLine = cmdLine;
     _helpDisplay = helpDisplay;
     _fileSystem = fileSystem;
     _msBuild = msBuild;
     _logger = logger;
     _processRunner = processRunner;
     _nuGet = nuGet;
 }