aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wikijscmd/commands.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/wikijscmd/commands.py b/wikijscmd/commands.py
index 5a10099..1da0ecd 100644
--- a/wikijscmd/commands.py
+++ b/wikijscmd/commands.py
@@ -2,6 +2,7 @@ import sys
import subprocess
import time
import os
+import difflib
from datetime import datetime, timedelta
@@ -86,7 +87,10 @@ def edit(path, save=False):
# Prompt user to save it to the wiki
print_item(page)
print("-" * 80)
- print(new_body)
+ print("".join(difflib.unified_diff(
+ body.splitlines(keepends=True),
+ new_body.splitlines(keepends=True)
+ )))
print("-" * 80)
if save or input("Save changes? (y/n) ") == "y":
response = graphql_queries.edit_page(page["id"], new_body, page["title"], page["path"])