Skip to content

Commit 79e1a7c

Browse files
committed
Catch parameters from --git and stuff them in as pre/post file args
1 parent 77c4633 commit 79e1a7c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/fdiff/__main__.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def run(argv):
3535
description="An OpenType table diff tool for fonts."
3636
)
3737
parser.add_argument("--version", action="version", version=f"fdiff v{__version__}")
38-
parser.add_argument("--git", type=str, nargs=7, action="git", help="Act as a diff driver for git (takes 7 parameters)")
38+
parser.add_argument("--git", type=str, nargs=7, help="Act as a diff driver for git (takes 7 parameters)")
3939
parser.add_argument(
4040
"-c",
4141
"--color",
@@ -65,11 +65,16 @@ def run(argv):
6565
"--nomp", action="store_true", help="Do not use multi process optimizations"
6666
)
6767
parser.add_argument("--external", type=str, help="Run external diff tool command")
68-
parser.add_argument("PREFILE", help="Font file path/URL 1")
69-
parser.add_argument("POSTFILE", help="Font file path/URL 2")
68+
# parser.add_argument("PREFILE", help="Font file path/URL 1")
69+
# parser.add_argument("POSTFILE", help="Font file path/URL 2")
7070

7171
args = parser.parse_args(argv)
7272

73+
if args.git:
74+
print(args.git)
75+
args.PREFILE = args.git[1]
76+
args.POSTFILE = args.git[4]
77+
7378
# /////////////////////////////////////////////////////////
7479
#
7580
# Validations
@@ -108,11 +113,6 @@ def run(argv):
108113
# optimization use
109114
use_mp = not args.nomp
110115

111-
if args.git:
112-
pass
113-
# TODO: catch 2nd & 5th parameters and stuff them in args.PREFILE and
114-
# args.POSTFILE respectively
115-
116116
if args.external:
117117
# ------------------------------
118118
# External executable tool diff

0 commit comments

Comments
 (0)