#!/usr/bin/env ruby
#
# tlog [FMT] - prefix lines with current timestamp
#
# ---
# source: https://leahneukirchen.org/dotfiles/bin/tlog

fmt = ARGV[0] || "%Y-%m-%d %H:%M:%S "

$stdin.sync = true

while line = $stdin.gets
  puts Time.now.strftime(fmt) + line
end
