diff options
author | Zapata <zapata@xs4all.nl> | 2011-01-29 22:31:36 +0100 |
---|---|---|
committer | Zapata <zapata@xs4all.nl> | 2011-01-29 22:31:36 +0100 |
commit | 6a9ba2257dfeccee61169c1e213515058eae2ba1 (patch) | |
tree | 3d33195f9b89863ebbea3c0951a41ef3bed57c1f /lib/keyringer/actions/recipients.rb | |
parent | 5196fb316c1afc2b6b0d11132e105c7f1fb841fe (diff) | |
parent | 4987cf64fcfd6c417c06a3f939182b1052fe57c9 (diff) | |
download | keyringer-6a9ba2257dfeccee61169c1e213515058eae2ba1.tar.gz keyringer-6a9ba2257dfeccee61169c1e213515058eae2ba1.tar.bz2 |
Merge remote branch 'origin/ruby' into ruby
Conflicts:
bin/keyringer
lib/keyringer.rb
Diffstat (limited to 'lib/keyringer/actions/recipients.rb')
-rw-r--r-- | lib/keyringer/actions/recipients.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/keyringer/actions/recipients.rb b/lib/keyringer/actions/recipients.rb new file mode 100644 index 0000000..16b5a88 --- /dev/null +++ b/lib/keyringer/actions/recipients.rb @@ -0,0 +1,24 @@ +module Keyringer
+ class Recipients
+ def execute
+ subCommand = ARGV[2]
+ parameters = ARGV[3..-1]
+
+ recipients = Keyring::Recipients.new
+
+ if subCommand == "add"
+ recipients.addRecipient(ARGV[3], ARGV[4])
+ elsif subCommand == "remove"
+ recipients.removeRecipient(ARGV[3])
+ elsif subCommand == "list"
+ recipients.listRecipients().each() do |recipient|
+ puts("#{recipient.email} #{recipient.keySignature}")
+ end
+ else
+ throw "Invalid recipients command: #{subCommand} "
+ end
+
+ return ""
+ end
+ end
+end
|