From 0b3bf4b04e558b5cccca0a3821de3e6af60aada5 Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 25 Oct 2012 13:56:19 -0700 Subject: suppress auth-agent warning --- lib/leap_cli/commands/user.rb | 6 +++--- lib/leap_cli/commands/util.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/leap_cli/commands/user.rb b/lib/leap_cli/commands/user.rb index ed56ff4..5f1b2d9 100644 --- a/lib/leap_cli/commands/user.rb +++ b/lib/leap_cli/commands/user.rb @@ -65,8 +65,8 @@ module LeapCli ssh_keys << SshKey.load(keyfile) end - if `which ssh-add && ssh-add -L`.strip.any? - `ssh-add -L`.split("\n").compact.each do |line| + if `which ssh-add`.strip.any? + `ssh-add -L 2> /dev/null`.split("\n").compact.each do |line| key = SshKey.load(line) key.comment = 'ssh-agent' ssh_keys << key unless ssh_keys.include?(key) @@ -102,7 +102,7 @@ module LeapCli if secret_keys.length > 1 key_index = numbered_choice_menu('Choose your OpenPGP public key', secret_keys) do |key, i| key_info = key.to_s.split("\n")[0..1].map{|line| line.sub(/^\s*(sec|uid)\s*/,'')}.join(' -- ') - say("#{i+1}. #{key_info}") + say("#{i+1}. #{key_info}") end else key_index = 0 diff --git a/lib/leap_cli/commands/util.rb b/lib/leap_cli/commands/util.rb index 46fe44b..aa888e0 100644 --- a/lib/leap_cli/commands/util.rb +++ b/lib/leap_cli/commands/util.rb @@ -16,7 +16,7 @@ module LeapCli; module Commands while true say("\n" + msg + ':') items.each_with_index &block - say("q. quit") + say("q. quit") index = ask("number 1-#{items.length}> ") if index.empty? next -- cgit v1.2.3