Fixes BZ #888357
Fixes BZ #888357
Reimplements the handling of --debug
There was no need for this function to be recursive.
Fixes the new --debug implementation
Merge pull request #42 from derekhiggins/alobbs

rebased debug options from Alobbs