From 83a467a4aa19f4d15f91f7deaa3016c00e7b87db Mon Sep 17 00:00:00 2001 From: KV Date: Sun, 13 Sep 2020 17:47:04 +0200 Subject: [PATCH] Add diff as an alias to the compare command When used to "git diff", it is easy to write "build_examples.py diff" instead of "build_examples.py compare" by a mistake. Therefore, "diff" is now an alias to "compare" so both commands will work. This solves part 3 of issue #167. --- src/wireviz/build_examples.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wireviz/build_examples.py b/src/wireviz/build_examples.py index 095cc0a..942fd80 100755 --- a/src/wireviz/build_examples.py +++ b/src/wireviz/build_examples.py @@ -129,7 +129,7 @@ def restore_generated(groupkeys, branch = ''): def parse_args(): parser = argparse.ArgumentParser(description='Wireviz Example Manager',) parser.add_argument('action', nargs='?', action='store', - choices=['build','clean','compare','restore'], default='build', + choices=['build','clean','compare','diff','restore'], default='build', help='what to do with the generated files (default: build)') parser.add_argument('-c', '--compare-graphviz-output', action='store_true', help='the Graphviz output is also compared (default: False)') @@ -147,7 +147,7 @@ def main(): build_generated(args.groups) elif args.action == 'clean': clean_generated(args.groups) - elif args.action == 'compare': + elif args.action == 'compare' or args.action == 'diff': compare_generated(args.groups, args.branch, args.compare_graphviz_output) elif args.action == 'restore': restore_generated(args.groups, args.branch)