【问题标题】:GroovyShell exit multilineGroovyShell 退出多行
【发布时间】:2017-10-17 08:17:20
【问题描述】:

输入无效输入时,GroovyShell 似乎不会退出多行。 示例:

groovy:000> InvalidClosure {
groovy:001> meaninglessCommands
groovy:002> }
ERROR groovy.lang.MissingMethodException:
No signature of method: groovysh_evaluate.InvalidClosure() is applicable 
for argument types: (groovysh_evaluate$_run_closure1) values: 
[groovysh_evaluate$_run_closure1@5a9f4771]
groovy:002>

无论我尝试什么,我都无法返回 groovy:000>,并且 REPL 一直在解释无效命令,因为它知道我仍在使用同一个多行命令。

如何退出这个多行实例?

【问题讨论】:

    标签: groovy groovyshell


    【解决方案1】:

    只需输入:clear

    groovy:000> ?
    [...]
    Available commands:
      :help      (:h ) Display this help message
      ?          (:? ) Alias to: :help
    [...]
      :display   (:d ) Display the current buffer
      :clear     (:c ) Clear the buffer and reset the prompt counter
    [...]
    

    【讨论】:

      猜你喜欢
      • 2012-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-14
      • 2014-07-28
      • 2014-08-01
      • 2019-10-15
      • 2015-11-17
      相关资源
      最近更新 更多