Commit 4a5980d

mo khan <mo@mokhan.ca>
2014-09-26 20:45:43
write to stdout.
1 parent 8a6f9a1
Changed files (1)
lib
lib/tfa/cli.rb
@@ -7,17 +7,17 @@ module TFA
 
     desc "add NAME SECRET", "add a new secret to the database"
     def add(name, secret)
-      AddCommand.new(storage).run([name, secret])
+      display AddCommand.new(storage).run([name, secret])
     end
 
     desc "show NAME", "shows the secret for the given key"
     def show(name)
-      ShowCommand.new(storage).run([name])
+      display ShowCommand.new(storage).run([name])
     end
 
     desc "totp NAME", "generate a Time based One Time Password"
     def totp(name)
-      TotpCommand.new(storage).run([name])
+      display TotpCommand.new(storage).run([name])
     end
 
     private
@@ -25,5 +25,9 @@ module TFA
     def storage
       @storage ||= Storage.new(filename: options[:filename] || 'tfa')
     end
+
+    def display(message)
+      puts message
+    end
   end
 end