Skip to content

Commit

Permalink
allow non-interactive password on login (-p or --password)
Browse files Browse the repository at this point in the history
  • Loading branch information
theganyo committed Jan 18, 2013
1 parent f08b377 commit f785dba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ugc/lib/ugc/commands/login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
command :login do |c|

c.switch [:a,:admin]
c.flag [:p,:password]
c.action do |global_options,options,args|

help_now! unless args[0]

password = ask('password: ') { |q| q.echo = '*' }
password = options[:password] || ask('password: ') { |q| q.echo = '*' }

if password
if options[:admin]
Expand Down

0 comments on commit f785dba

Please sign in to comment.