log exceptions as error
minor refactoring (method renaming)
using docopt instead of parseopt
added return value 2, that is used to mark a successful execution but no new config file was written