@@ -233,15 +233,16 @@ def upload_files(ctx, project_id, project_path, filter_glob, exit_on_error):
233233@click .argument ("project_id" )
234234@click .argument ("local_dir" )
235235@click .option (
236- "--path-starts-with" ,
237- help = "Do not download the whole project, but only the files which path starts with the string." ,
236+ "--filter" ,
237+ "filter_glob" ,
238+ help = "Do not download the whole project, but only the files which match the glob." ,
238239)
239240@click .option (
240241 "--exit-on-error/--no-exit-on-error" ,
241242 help = "If any project file downloads fails stop downloading the rest. Default: False" ,
242243)
243244@click .pass_context
244- def download_files (ctx , project_id , local_dir , path_starts_with , exit_on_error ):
245+ def download_files (ctx , project_id , local_dir , filter_glob , exit_on_error ):
245246 """Download QFieldCloud project files."""
246247
247248 def downloaded_cb (file ):
@@ -254,7 +255,7 @@ def download_files(ctx, project_id, local_dir, path_starts_with, exit_on_error):
254255 print (f'File "{ file ["name" ]} " has been downloaded successfully.' )
255256
256257 files = ctx .obj ["client" ].download_files (
257- project_id , local_dir , path_starts_with , exit_on_error , finished_cb = downloaded_cb
258+ project_id , local_dir , filter_glob , exit_on_error , finished_cb = downloaded_cb
258259 )
259260
260261 if ctx .obj ["format_json" ]:
@@ -265,9 +266,9 @@ def download_files(ctx, project_id, local_dir, path_starts_with, exit_on_error):
265266 for file in files :
266267 print (f'{ file ["status" ].value } \t { file ["name" ]} ' )
267268 else :
268- if path_starts_with :
269+ if filter_glob :
269270 print (
270- f"No files to download for project { project_id } at { path_starts_with } "
271+ f"No files to download for project { project_id } at { filter_glob } "
271272 )
272273 else :
273274 print (f"No files to download for project { project_id } " )
@@ -318,16 +319,17 @@ def package_status(ctx, project_id):
318319@click .argument ("project_id" )
319320@click .argument ("local_dir" )
320321@click .option (
321- "--path-starts-with" ,
322- help = "Do not download all the packaged files, but only the files which path starts with the string." ,
322+ "--filter" ,
323+ "filter_glob" ,
324+ help = "Do not download the whole packaged project, but only the files which match the glob." ,
323325)
324326@click .option (
325327 "--exit-on-error/--no-exit-on-error" ,
326328 help = "If any packaged file downloads fails stop downloading the rest. Default: False" ,
327329)
328330@click .pass_context
329- def package_download (ctx , project_id , local_dir , path_starts_with , exit_on_error ):
330- """Download QFieldCloud project files."""
331+ def package_download (ctx , project_id , local_dir , filter_glob , exit_on_error ):
332+ """Download packaged QFieldCloud project files."""
331333
332334 def downloaded_cb (file ):
333335 if ctx .obj ["format_json" ]:
@@ -339,7 +341,7 @@ def package_download(ctx, project_id, local_dir, path_starts_with, exit_on_error
339341 print (f'Packaged file "{ file ["name" ]} " has been downloaded successfully.' )
340342
341343 files = ctx .obj ["client" ].package_download (
342- project_id , local_dir , path_starts_with , exit_on_error , finished_cb = downloaded_cb
344+ project_id , local_dir , filter_glob , exit_on_error , finished_cb = downloaded_cb
343345 )
344346
345347 if ctx .obj ["format_json" ]:
@@ -350,9 +352,9 @@ def package_download(ctx, project_id, local_dir, path_starts_with, exit_on_error
350352 for file in files :
351353 print (f'{ file ["status" ].value } \t { file ["name" ]} ' )
352354 else :
353- if path_starts_with :
355+ if filter_glob :
354356 print (
355- f"No packaged files to download for project { project_id } at { path_starts_with } "
357+ f"No packaged files to download for project { project_id } at { filter_glob } "
356358 )
357359 else :
358360 print (f"No packaged files to download for project { project_id } " )
0 commit comments