Exemple #1
0
 /// <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);
         }
     }
 }
Exemple #2
0
 /// <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));
 }
Exemple #3
0
 /// <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));
 }
Exemple #4
0
 public ExitCommand(Gin interpreter)
 {
     this.interpreter = interpreter;
 }