aboutsummaryrefslogtreecommitdiff
path: root/lib/keyringer/recipients.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/keyringer/recipients.rb')
-rw-r--r--lib/keyringer/recipients.rb24
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