Permalink
Browse files

Make usable from command line

  • Loading branch information...
1 parent b4580c7 commit 0cbcb0a87436e950796ca1f574456cc2eb201520 @mattwildig committed Mar 7, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 1_solitaire/solitaire.rb
View
@@ -148,4 +148,14 @@ def self.key_deck passphrase
k.deck
end
+end
+
+if __FILE__ == $0
+ if ARGV[0] == '-e'
+ puts Solitaire.encrypt ARGV[1..-1].join(' '), Solitaire::UNKEYED_DECK
+ elsif ARGV[0] == '-d'
+ puts Solitaire.decrypt ARGV[1..-1].join(' '), Solitaire::UNKEYED_DECK
+ else
+ puts "Wrong arguments"
+ end
end

0 comments on commit 0cbcb0a

Please sign in to comment.