From 7ce5e1cbe9c66a9443d7571173cbc755c4be3327 Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Thu, 8 Nov 2018 09:31:03 +0000 Subject: [type7] print the spell that magic mode casts --- type7 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1