在irb中,quit和exit的区别是什么?

3

使用 quit 或 exit 命令退出 irb 有什么区别吗?

比如说,下面两个命令在功能上是否完全相同:

irb(main):001:0> quit

并且

irb(main):001:0> exit

3
如果你需要其他选项,还可以使用irb_exit - roippi
1个回答

8
看起来是这样的。
method(:quit).owner    #=> IRB::ExtendCommandBundle
method(:exit).owner    #=> IRB::ExtendCommandBundle
method(:exit).source_location
#=> ["/usr/local/lib/ruby/2.2.0/irb/extend-command.rb", 28]
method(:quit).source_location
#=> ["/usr/local/lib/ruby/2.2.0/irb/extend-command.rb", 28]
method(:exit) == method(:quit)    #=> true

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接