TODO:
- test the rewritten 'output from commandline'.
- unit tests
