Skip to content

Commit

Permalink
Add -o / --out-file to grg construct
Browse files Browse the repository at this point in the history
Lets user name their resulting GRG.
  • Loading branch information
dcdehaas committed Sep 6, 2024
1 parent 47873c1 commit 2d5c3e7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pygrgl/clicmd/construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def add_options(subparser):
"tab-separate file, using the given fieldname.")
subparser.add_argument("--bs-triplet", default=0,
help="Run the triplet algorithm for this many iterations in BuildShape")
subparser.add_argument("--out-file", "-o", default=None,
help="Specify an output file instead of using the default name.")
subparser.add_argument("--verbose", "-v", action="store_true",
help="Verbose output, including timing information.")

Expand Down Expand Up @@ -169,7 +171,11 @@ def verify_file(fn):

# Now merge them pairwise.
print("Merging...")
final_filename = f"{base_name}.final.grg"
if args.out_file is not None:
final_filename = args.out_file
else:
final_filename = f"{base_name}.final.grg"

command = [grg_merge_exe, "-s", final_filename, ]
command.extend(map(lambda part: out_filename(input_file, part), range(0, args.parts)))
print(command)
Expand Down

0 comments on commit 2d5c3e7

Please sign in to comment.