lib/conjur/command/users.rb in conjur-cli-2.1.3 vs lib/conjur/command/users.rb in conjur-cli-2.1.4
- old
+ new
@@ -15,10 +15,14 @@
c.action do |global_options,options,args|
login = require_arg(args, 'login')
opts = options.slice(:ownerid)
if options[:p]
- hl = HighLine.new
+
+ # use stderr to allow output redirection, e.g.
+ # conjur user:create -p username > user.json
+ hl = HighLine.new($stdin, $stderr)
+
password = hl.ask("Enter the password (it will not be echoed): "){ |q| q.echo = false }
confirmation = hl.ask("Confirm the password: "){ |q| q.echo = false }
raise "Password does not match confirmation" unless password == confirmation