Skip to content

Commit 9327a43

Browse files
committed
Catch parameters from --git and stuff them in as pre/post file args
1 parent 13be898 commit 9327a43

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",
@@ -64,11 +64,16 @@ def run(argv):
6464
"--nomp", action="store_true", help="Do not use multi process optimizations"
6565
)
6666
parser.add_argument("--external", type=str, help="Run external diff tool command")
67-
parser.add_argument("PREFILE", help="Font file path/URL 1")
68-
parser.add_argument("POSTFILE", help="Font file path/URL 2")
67+
# parser.add_argument("PREFILE", help="Font file path/URL 1")
68+
# parser.add_argument("POSTFILE", help="Font file path/URL 2")
6969

7070
args = parser.parse_args(argv)
7171

72+
if args.git:
73+
print(args.git)
74+
args.PREFILE = args.git[1]
75+
args.POSTFILE = args.git[4]
76+
7277
# /////////////////////////////////////////////////////////
7378
#
7479
# Validations
@@ -118,11 +123,6 @@ def run(argv):
118123
# optimization use
119124
use_mp = not args.nomp
120125

121-
if args.git:
122-
pass
123-
# TODO: catch 2nd & 5th parameters and stuff them in args.PREFILE and
124-
# args.POSTFILE respectively
125-
126126
if args.external:
127127
# ------------------------------
128128
# External executable tool diff

0 commit comments

Comments
 (0)