Implemented reading from command line or with redirection