Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the "irb(main):001:0>" prompt instead of ">>"

Tags:

ruby

irb

Ruby is preinstalled on my Mac and so I wanted to have a look at it. First thing I noticed, is that irb prompts >> instead of irb(main):001:0>. I can't find anything on how to change this with Google because everyone is using irb(main):001:0> in their code ;-)

Can you help me out?

PS: It's not that I think Ruby is broken, but I want to look more nerdy while programming ;-)

like image 311
Christian Avatar asked Dec 23 '22 13:12

Christian


1 Answers

$ irb --help
Usage:  irb.rb [options] [programfile] [arguments]
  --prompt prompt-mode
  --prompt-mode prompt-mode
            Switch prompt mode. Pre-defined prompt modes are
            `default', `simple', `xmp' and `inf-ruby'

$ irb --prompt inf-ruby
irb(main):001:0> 
like image 149
troelskn Avatar answered Jan 10 '23 15:01

troelskn