add basic stdin support. close #2