private static void ExecuteCommand(Command command, List<string> args) { if (command.Execute(args)) return; Console.Error.WriteLine("{0}: {1}", command.Name, command.Description); Console.Error.WriteLine(); Console.Error.WriteLine("Usage:"); Console.Error.WriteLine("{0}", command.Usage); Console.Error.WriteLine(); Console.Error.WriteLine("Use \"help {0}\" for more information.", command.Name); }
/// <summary> /// Adds a command to the context. /// </summary> /// <param name="command">The command to add.</param> public void AddCommand(Command command) { _commandsByName[command.Name] = command; }