summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Lasseter <Nat Lasseter nathan@bytemark.co.uk>2018-11-08 09:31:03 +0000
committerNat Lasseter <Nat Lasseter nathan@bytemark.co.uk>2018-11-08 09:31:03 +0000
commit7ce5e1cbe9c66a9443d7571173cbc755c4be3327 (patch)
tree6164b31fd804306b6b5c5ee296fd834a9a658e59
parentce90e571393614254112c052ad4813768e8d84f0 (diff)
[type7] print the spell that magic mode casts
-rwxr-xr-xtype712
1 files changed, 11 insertions, 1 deletions
diff --git a/type7 b/type7
index db423cb..e92cb66 100755
--- a/type7
+++ b/type7
@@ -36,6 +36,12 @@ def mode_looks_like(args)
return :encode
end
+name = {
+ equal: "Test Equality",
+ decode: "Decode",
+ encode: "Encode"
+}
+
require 'optparse'
options = {:mode => :magic}
@@ -63,7 +69,11 @@ OptionParser.new do |opts|
end
end.parse!
-options[:mode] = mode_looks_like(ARGV) if options[:mode] == :magic
+if options[:mode] == :magic
+ print "Magic mode casts: "
+ options[:mode] = mode_looks_like(ARGV)
+ puts name[options[:mode]]
+end
case options[:mode]
when :encode