Refactored the command line to use a mock instead of weird streams.