Skip to content

Commit

Permalink
Add diff as an alias to the compare command
Browse files Browse the repository at this point in the history
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 wireviz#167.
  • Loading branch information
kvid committed Oct 10, 2020
1 parent 2c54dc4 commit 5f247b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wireviz/build_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)')
Expand All @@ -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)
Expand Down

0 comments on commit 5f247b3

Please sign in to comment.