diff options
author | Olivier Lacan <hi@olivierlacan.com> | 2023-08-17 17:28:16 -0700 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-08-18 01:02:42 +0000 |
commit | 43802a088e204c32564c243d8f99f8980b150279 (patch) | |
tree | 226594cd166c6f5ea9575ecaa35657f9229fee9b /ext | |
parent | ad2bad4ab42c490beca0bd3c5cd9846fdff238c2 (diff) |
[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.
https://github.com/ruby/io-console/commit/4d324586a8
Diffstat (limited to 'ext')
-rw-r--r-- | ext/io/console/console.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 6dadc8d0d6..836391f370 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -1578,6 +1578,12 @@ str_chomp(VALUE str) * see String#chomp!. * * You must require 'io/console' to use this method. + * + * require 'io/console' + * IO::console.getpass("Enter password: ") + * Enter password: + * # => "mypassword" + * */ static VALUE console_getpass(int argc, VALUE *argv, VALUE io) |