diff options
-rwxr-xr-x | goforthanddie.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/goforthanddie.rb b/goforthanddie.rb index e81d534..5e4af9e 100755 --- a/goforthanddie.rb +++ b/goforthanddie.rb @@ -164,6 +164,15 @@ def handle(str, stack, markermode, markerautoclear, destructiveprint) print "Marker Mode: #{markermode ? "ON " : "OFF"} " puts "Marker Auto-Clear: #{markerautoclear ? "ON " : "OFF"}" puts "Destructive Print: #{destructiveprint ? "ON " : "OFF"}" + when "~user" + puts "User definitions:" + file = File. + readlines(File.join(ENV['HOME'], ".goforthanddie")). + map { |line| line.split(?:) } + namemax = file.map {|defn| defn[0].length}.max + 1 + file.each do |name, defn| + puts " %#{namemax}s: #{defn}" % "'#{name}" + end when "~q", "~quit" exit else |