See also:
In reply to Re: How to write testable command line script? by eyepopslikeamosquito in thread How to write testable command line script? by thechartist