added recursive mode to the optsparser