diff options
author | Zapata <zapata@xs4all.nl> | 2011-01-29 22:13:05 +0100 |
---|---|---|
committer | Zapata <zapata@xs4all.nl> | 2011-01-29 22:13:05 +0100 |
commit | e65dbf59bf3aaa0b4bde29ca49ca67f7ad17b5a9 (patch) | |
tree | cd914b8c588ea35f732abdbd7336d3c459804b70 /lib/keyringer/recipients.rb | |
parent | 7382be9d83bc5f95ad8d184b95c379ca5b9d1725 (diff) | |
download | keyringer-e65dbf59bf3aaa0b4bde29ca49ca67f7ad17b5a9.tar.gz keyringer-e65dbf59bf3aaa0b4bde29ca49ca67f7ad17b5a9.tar.bz2 |
added preliminary recipient management functionality
Diffstat (limited to 'lib/keyringer/recipients.rb')
-rw-r--r-- | lib/keyringer/recipients.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/keyringer/recipients.rb b/lib/keyringer/recipients.rb new file mode 100644 index 0000000..16b5a88 --- /dev/null +++ b/lib/keyringer/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
|