def read_file_or_stdin(filename = nil)
      filename.nil? ? !STDIN.tty? && STDIN.read : File.read(filename)
    end
def read_file_or_stdin(filename = nil)
      filename.nil? ? !STDIN.tty? && STDIN.read : File.read(filename)
    end
Reads a file or from STDIN if piped