@@ -469,11 +469,11 @@ def print_basic_job_details(job: dict):
469
469
470
470
471
471
@cli .command ()
472
- @click .argument ("job_id " , type = str )
472
+ @click .argument ("job_ids " , type = str , nargs = - 1 )
473
473
@click .option ("--username" , type = str , hidden = True )
474
474
@click .option ("--verbose" , default = False , is_flag = True , hidden = True )
475
475
@click .pass_context
476
- def batch_download (ctx , job_id , username , verbose ):
476
+ def batch_download (ctx , job_ids , username , verbose ):
477
477
"""Download output files for a job."""
478
478
config = load_config (ctx .obj ["config_file" ])
479
479
@@ -518,17 +518,18 @@ def walk_fileshare(dir_name):
518
518
share_client = ShareClient .from_connection_string (config ['STORAGE' ]['CONNECTION_STRING' ],
519
519
config ['STORAGE' ]['FILESHARE' ])
520
520
521
- # if the job directory exist, exit with error
522
- top_level = f"{ username } /{ job_id } "
523
- destination = Path ("." , "outputs" , top_level )
524
- if os .path .exists (destination ):
525
- print ("ERROR: Local directory already exists. Please move or delete." )
526
- print ("Directory:" , destination )
527
- return
528
-
529
- print (f"Downloading { top_level } " )
530
- walk_fileshare (top_level )
531
- print ("\r Download complete. " )
521
+ for job_id in job_ids :
522
+ # if the job directory exist, print error and continue to next job_id
523
+ top_level = f"{ username } /{ job_id } "
524
+ destination = Path ("." , "outputs" , top_level )
525
+ if os .path .exists (destination ):
526
+ print ("ERROR: Local directory already exists. Please move or delete." )
527
+ print ("Directory:" , destination )
528
+ continue
529
+
530
+ print (f"Downloading { top_level } " )
531
+ walk_fileshare (top_level )
532
+ print ("\r Download complete. " )
532
533
533
534
534
535
def load_config (config_file ):
0 commit comments