What's the difference between the ruby irb prompt modes?

后端 未结 2 763
无人共我
无人共我 2021-01-06 09:19

I can change the irb prompt mode with

irb --prompt prompt-mode

I can see what null and simple does, but I can\'t

2条回答
  •  借酒劲吻你
    2021-01-06 09:31

    Once you read the article cldwalker posted above, you may want to design a custom prompt, here's mine for example:

    IRB.conf[:PROMPT][:CUSTOM] = {
      :PROMPT_I => ">> ",
      :PROMPT_S => "%l>> ",
      :PROMPT_C => ".. ",
      :PROMPT_N => ".. ",
      :RETURN => "=> %s\n"
    }
    IRB.conf[:PROMPT_MODE] = :CUSTOM
    IRB.conf[:AUTO_INDENT] = true
    

提交回复
热议问题