I'm using TCLAP on Debian (libtclap-dev 1.2.2-1+b1) and I use it to parse messages I send between long-running programs. Sometimes I mistype an argument name which leads to a call to exit() at the end of CmdLine::parse, killing my program. Could that function instead just throw an ExitException I can catch?
Would it work to call setExceptionHandling(false) to allow the exception to propagate?
That works nicely for me, thank you.
I think the manual should be updated, in the example it says "catch (TCLAP::ArgException &e) // catch any exceptions" so I got confused when my program terminated and gdb wouldn't show me any reason for that.
Yeah, this was initially added as an internal implementation detail to allow resources to be cleaned up before exiting, but it can actually be useful in cases such as you described. I think we should document it properly.
Documentation has been updated for both 1.2 and 1.4.