def add_opt(self, opt, long, arg, key, usage, multi=0):
        """Add a new option to the parser's tables.

        opt     => short option, e.g., '-s', *not* 's' or 's:'.
        long    => long option, e.g., '--spam', *not* '--spam='.
        arg     => descriptive name for arg to option, if it has an
                   an arg, e.g., 'how-much-spam'.
        key     => a unique key to identify this option; see
                   xgetopt.getopt().
        usage   => usage text for this option; may contain references
                   to members of the opt_info dictionary such as %(opt)s
                   and %(arg)s; '\n' is a paragraph separator.
        multi   => if true, multiple values for the option are distinct;
                   if false, only the last value is significant. See
                   xgetopt.getopt() for detail.
        """
        self.__usage = None
        # Build opt def'n dict
        opt_info = {}
        opt_info['opt'] = opt
        opt_info['long'] = long
        opt_info['arg'] = arg
        opt_info['key'] = key
        opt_info['usage'] = usage
        opt_info['multi'] = multi
        # Setup for getopt
        # Make index entries
        if opt:
            self.__odict[opt] = opt_info
            if arg:
                opt = opt + ':'
            self.__s.append(opt[1:])
        if long:
            self.__odict[long] = opt_info
            if arg:
                long = long + '='
            self.__l.append(long[0:])
        # Split usage into paragraphs and substitute vars.
        # This is gonna die a horrible death if the string
        # has bad variable substitutions in it.
        if usage:
            opt_info['usage'] = string.split(usage % opt_info, '\n\n')
        # Add to list of options
        self.__olist.append(opt_info)
        return opt_info
Add a new option to the parser's tables.

        opt     => short option, e.g., '-s', *not* 's' or 's:'.
        long    => long option, e.g., '--spam', *not* '--spam='.
        arg     => descriptive name for arg to option, if it has an
                   an arg, e.g., 'how-much-spam'.
        key     => a unique key to identify this option; see
                   xgetopt.getopt().
        usage   => usage text for this option; may contain references
                   to members of the opt_info dictionary such as %(opt)s
                   and %(arg)s; '
' is a paragraph separator.
        multi   => if true, multiple values for the option are distinct;
                   if false, only the last value is significant. See
                   xgetopt.getopt() for detail.
        
recipes/Python/80308_xgetopt_solutimanaging_commnad_line_args_usage/recipe-80308.py