def getopt(self, args, app_opts = None):
        """Parse string 'args' using saved option info.

        Returns a 3-tuple (opts, args, app_opts). Opts and args
        are the conventional values returned by getopt.getopt().

        App_opts is a dictionary mapping the 'key' given to add_opt()
        for each option to the value present on the command line.

        1. If the app_opts dictionary is passed in, this gives the
        default values for options for the application.

        2. Options not present in a passed-in app_opts, and not present
        on the command line have a mapped value of None.

        2. Options that have the 'multi' flag set have a mapped value
        of a list containing all values for the option that were given
        on the command line, in the order they were given.

        """
        # set up dict for caller
        if app_opts is None:
            app_opts = {}
        for oinfo in self.__olist:
            if not app_opts.has_key(oinfo['key']):
                app_opts[oinfo['key']] = None

        # Do the getopt thing
        opts, args = getopt.getopt(args,
                                   string.join(self.__s, ''),
                                   string.join(self.__l, ' '))

        # now fill in caller dict
        for k, v in opts:
            app_key = self.__odict[k]['key']
            app_multi = self.__odict[k]['multi']
            if app_multi:
                if not app_opts[app_key]:
                    app_opts[app_key] = []
                app_opts[app_key].append(v)
            else:
                app_opts[app_key] = v

        # return 3-tuple to caller
        return opts, args, app_opts
Parse string 'args' using saved option info.

        Returns a 3-tuple (opts, args, app_opts). Opts and args
        are the conventional values returned by getopt.getopt().

        App_opts is a dictionary mapping the 'key' given to add_opt()
        for each option to the value present on the command line.

        1. If the app_opts dictionary is passed in, this gives the
        default values for options for the application.

        2. Options not present in a passed-in app_opts, and not present
        on the command line have a mapped value of None.

        2. Options that have the 'multi' flag set have a mapped value
        of a list containing all values for the option that were given
        on the command line, in the order they were given.

        
recipes/Python/80308_xgetopt_solutimanaging_commnad_line_args_usage/recipe-80308.py