import click


def is_command(obj):
    """ Examine the object to determine if it is wrapping a click.Command

    :param obj: the object in question
    :returns: if the object is a click.Command in some fashion
    """
    # Using self of the bound method so this is safe across weirdly decorated commands.
    return hasattr(obj, 'parse_args') and isinstance(obj.parse_args.__self__, click.Command)