def show_diff(args, repo, extension):
    """
    Shows diffs for files or whole article directory
    """
    colorization = "always"
    unifiedopt = "0"

    args = args.split()
    if 1 > len(args):
        if os.path.isfile(os.path.join(os.getcwd(), add_fileextension(args[1], extension))):
            # diff 7 article
            try:
                print(repo.git.diff('HEAD~'+args[0], add_fileextension(args[1], extension),
                                    unified=unifiedopt, color=colorization))
            except git.exc.GitCommandError:
                print("Error: Not a valid git commit reference")
        else:
            print("Error: Wrong Usage. See help diff")
    elif len(args) == 1:
        # diff 7
        try:
            print(repo.git.diff('HEAD~'+args[0],
                                unified=unifiedopt, color=colorization))
        except git.exc.GitCommandError:
            print("Error: Not a valid git commit reference")
    else:
        try:
            print(repo.git.diff('HEAD~1', unified="0", color="always"))
        except git.exc.GitCommandError:
            print("Error: Not a valid git commit reference")
dataset/ETHPy150Open noqqe/cmddocs/cmddocs/articles.py/show_diff/swapped operands of `>`