diff options
author | Nat Lasseter <user@4574.co.uk> | 2024-09-03 19:48:26 +0100 |
---|---|---|
committer | Nat Lasseter <user@4574.co.uk> | 2024-09-03 19:48:26 +0100 |
commit | 8336adc85e357cd5131f7d77ac8e01ad6f57b058 (patch) | |
tree | b782520533c0a5e5fe710efbf7dc1ee269fc139a | |
parent | adb6f21dd3f2db293e0791c3a9ea5621da07cd38 (diff) |
[goforthanddie] add ~user to print userdefs
-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 |