
                             S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSKJ
r
  SS	KJr  SS
KJr  SSKJr  SSKJr  \R                    " S S\R"                  5      5       rg)z.Implementation of command for listing folders.    )absolute_import)division)unicode_literals)base)errors_util)flags)folder_util)storage_url)wildcard_iterator)full_resource_formatter)resource_utilc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g)	List   zList folders.a  
      The following command lists all folders in a hierarchical namespace bucket:

        $ {command} gs://my-bucket/

      The following command lists all folders under a parent folder:

        $ {command} gs://my-bucket/parent-folder/

      You can use [wildcards](https://cloud.google.com/storage/docs/wildcards)
      to match multiple paths (including multiple buckets). Bucket wildcards are
      expanded to match only buckets contained in your current project. The
      following command matches folders that are stored in buckets
      in your project that begin with ``my-b'':

        $ {command} gs://my-b*/

      Following is another example where we are listing all folders that
      begin with ``B'' under a given bucket:

        $ {command} gs://my-bucket/B*
      )DESCRIPTIONEXAMPLESc                     U R                  S[        SSS9  [        R                  " U 5        [        R                  " U 5        g )Nurl+z"The URLs of the resources to list.)typenargshelp)add_argumentstrr   add_additional_headers_flagadd_raw_display_flag)parsers    #lib/surface/storage/folders/list.pyArgs	List.Args=   s=    
Cs)M   
%%f-	v&    c              #     #    / nUR                    HK  n[        R                  " U5      n[        R                  " UR
                  U5        UR                  U5        MM     U Hv  n[        R                  " UR                  S5      [        R                  R                  S9 H3  n[        R                  " U[        R                   UR"                  S9v   M5     Mx     g 7f)Nz**)folder_setting)display_raw_keys)r   r
   storage_url_from_stringr   raise_error_if_not_gcscommand_pathappendr   CloudWildcardIteratorjoinr	   FolderSettingLIST_WITHOUT_OBJECTSr   get_display_dict_for_resourcer   FolderDisplayTitlesAndDefaultsraw)selfargsurls
url_stringr   resources         r   RunList.RunE   s     Dhh
//
;c(():):C@
kk# 
 '==
((4.$22GG( 99#BB!XX
 	
	 s   CC N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r5   __static_attributes__r7   r!   r   r   r      s/     )
-4 ' '
r!   r   N)r<   
__future__r   r   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   r   r	   r
   r   ,googlecloudsdk.command_lib.storage.resourcesr   r   DefaultUniverseOnlyListCommandr   r7   r!   r   <module>rF      sR    5 &  ' ( : 4 : : @ P F 5
4 5
 5
r!   