added support for optparse