Skip to content

Commit 15485c3

Browse files
committed
[__main__] add fdiff executable option to eliminate MP optimizations
1 parent 6a0f26c commit 15485c3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/fdiff/__main__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def run(argv):
5959
)
6060
parser.add_argument("--head", type=int, help="Display first n lines of output")
6161
parser.add_argument("--tail", type=int, help="Display last n lines of output")
62+
parser.add_argument(
63+
"--nomp", action="store_true", help="Do not use multi process optimizations"
64+
)
6265
parser.add_argument("PREFILE", help="Font file path 1")
6366
parser.add_argument("POSTFILE", help="Font file path 2")
6467

@@ -113,6 +116,10 @@ def run(argv):
113116
include_list = get_tables_argument_list(args.include)
114117
exclude_list = get_tables_argument_list(args.exclude)
115118

119+
# flip logic of the command line flag for multi process
120+
# optimizations for use as a u_diff function argument
121+
use_mp = not args.nomp
122+
116123
# perform the unified diff analysis
117124
try:
118125
diff = u_diff(
@@ -121,6 +128,7 @@ def run(argv):
121128
context_lines=args.lines,
122129
include_tables=include_list,
123130
exclude_tables=exclude_list,
131+
use_multiprocess=use_mp,
124132
)
125133
except Exception as e:
126134
sys.stderr.write(f"[*] ERROR: {e}{os.linesep}")

0 commit comments

Comments
 (0)