better file/stdin support