/// <summary> /// Runs command input loop. /// </summary> /// <param name="gin"></param> public static void RunInputLoop(this Gin gin) { while (!gin.NeedToExit) { Console.Write("\r\n> "); var command = Console.ReadLine(); if (!string.IsNullOrWhiteSpace(command)) { gin.Execute(command); } } }
/// <summary> /// Adds the help command to the Gin's library /// </summary> /// <param name="gin"></param> public static void AddHelp(this Gin gin) { gin.Library.Registrate(new HelpCommand(gin.Library.Sketches)); }
/// <summary> /// Adds the exit command to the Gin's library /// </summary> /// <param name="gin"></param> public static void AddExit(this Gin gin) { gin.Library.Registrate(new ExitCommand(gin)); }
public ExitCommand(Gin interpreter) { this.interpreter = interpreter; }