'Parse command line arguments.
Will recursively parse commands until a final parser is found or an
error occurs. In the case of errors we will print a message and exit.
Otherwise, any overrides are applied and the current parser stored
in the command attribute of the return value.
:param args: list of arguments to parse
:type args: list of strings
:param prog: name to use for program
:type prog: string
:rtype: :class:`argparse.Namespace`'

def parse(self, args, prog=None):

    prog = (prog or os.path.basename(sys.argv[0]))
    try:
        return self._parse(args, argparse.Namespace(), self._overrides.copy(), prog)
    except _HelpError:
        self.exit(0, self.format_help(prog))
