Changing example cli script to work with Unix pipes and command line arguments.