ugly fix

Fixes #963

Quick hack for now. When we split the command line processing code to a new python module, this script will go with it and will be re-factored at that time. 

Don't merge until 1.7.0-dev!