def GetMethod(parser, group):
    """
    If group is defined, then return the method to add this option to the group of options.  Otherwise
    return a method which will add it to the 'generic' options.
    """

    if group == '':
        method = parser.add_option
    else:
        method = group.add_option
    return method