File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -653,6 +653,29 @@ def reset(ctx):
653653 except Exception as e :
654654 _print_unhandled_exception ()
655655
656+ @cli .command ()
657+ @click .argument ("namespace" )
658+ @click .argument ("project" )
659+ @click .option ("--fmt_json" , is_flag = True , default = False , help = "Output in JSON format" )
660+ @click .pass_context
661+ def list_files (ctx , namespace , project ,fmt_json ):
662+ """List files in a project."""
663+
664+ mc = ctx .obj ["client" ]
665+ if mc is None :
666+ return
667+
668+ #projects_files = mc.projects_files(name=project, namespace=namespace)
669+ project_info = mc .project_info (namespace + "/" + project )
670+ project_files = project_info ["files" ]
671+
672+ if fmt_json :
673+ print (project_files )
674+ else :
675+ click .echo ("Fetched {} files ." .format (len (project_files )))
676+ for file in project_files :
677+ click .echo (" {:40}\t {:6.1f} MB" .format (file ['path' ], file ["size" ] / (1024 * 1024 )))
678+
656679
657680if __name__ == "__main__" :
658681 cli ()
You can’t perform that action at this time.
0 commit comments