开发者

How to remove newline from ask method in Highline library?

I need a way to remove the newline from the ask method included in highline. Here's my current code:

pass = ask( "Enter your password > " ) { |passman| passman.echo = false }

But whenever I run the that, the output is

Enter your password > 
(typing goes here)

and I wish for th开发者_JAVA技巧is to not have a newline character. Any suggestions?


doc: highline says:

If the provided statement ends with a space or tab character, a newline will not be appended (output will be flush()ed).

So try it with a space:

pass = ask( "Enter your password > " ) { |passman| passman.echo = false }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜