Skip to content

Commit 2713fd5

Browse files
authored
Merge pull request #60 from Sunmish/textfile-input
allow input listfile to avoid sh limits on max number of arguments on the command line
2 parents cf959ba + 14a86e9 commit 2713fd5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

racs_tools/beamcon_2D.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ def main(
489489
tolerance: float = 0.0001,
490490
nsamps: int = 200,
491491
epsilon: float = 0.0005,
492+
listfile: bool = False,
492493
):
493494
"""Main script.
494495
@@ -525,6 +526,9 @@ def main(
525526
outdir = os.path.abspath(outdir)
526527

527528
# Get file list
529+
if listfile:
530+
with open(infile[0]) as f:
531+
infile = f.read().splitlines()
528532
files = sorted(infile)
529533
if files == []:
530534
raise Exception("No files found!")
@@ -664,6 +668,12 @@ def cli():
664668
nargs="+",
665669
)
666670

671+
parser.add_argument(
672+
"--listfile",
673+
action="store_true",
674+
help="Switch to assume `infile` is a text file list of images.",
675+
)
676+
667677
parser.add_argument(
668678
"-p",
669679
"--prefix",

0 commit comments

Comments
 (0)