support stdin in command line tool