Skip to content

Commit 43802a0

Browse files
olivierlacanmatzbot
authored andcommitted
[ruby/io-console] [DOC] IO::console.getpass usage example
There were no clear example of this very useful method's usage anywhere in the IO or IO::Console docs, which was a shame. ruby/io-console@4d324586a8
1 parent ad2bad4 commit 43802a0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/io/console/console.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,12 @@ str_chomp(VALUE str)
15781578
* see String#chomp!.
15791579
*
15801580
* You must require 'io/console' to use this method.
1581+
*
1582+
* require 'io/console'
1583+
* IO::console.getpass("Enter password: ")
1584+
* Enter password:
1585+
* # => "mypassword"
1586+
*
15811587
*/
15821588
static VALUE
15831589
console_getpass(int argc, VALUE *argv, VALUE io)

0 commit comments

Comments
 (0)