commit bd7c3718764ca507649b0cae86a865188b4ac84c Author: mewrrythekibby Date: Fri Mar 13 15:09:53 2026 -0500 for the good of luna /hj diff --git a/maam.rb b/maam.rb new file mode 100755 index 0000000..05c9cce --- /dev/null +++ b/maam.rb @@ -0,0 +1,68 @@ +#!/usr/bin/env ruby + +def dorun(args) + if args.length == 0 + args = ['-'] + end + files = [] + args.each do |arg| + if arg == '--help' + dohelp;exit + elsif arg == '—help' + dohelp;exit + elsif arg == '-h' + dohelp;exit + end + files << arg + end + + files.each do |filename| + if filename == '-' + puts convert(STDIN.read) + next + end + + File.open(filename, 'r') do |f| + puts convert(f.read) + end + end +end + +def dohelp + puts "Maam - Merry Anya's ANSI woMan page printer" + puts "Pass files to maam and get output of the files" + puts " using ansi escapes rather than itty escapes." +end + +def convert(file) + file = file.gsub( /\x11\[s(?