
                             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\R$                  5      r\R(                   " S S\R*                  5      5       rg)zCommand to list properties.    )absolute_import)division)unicode_literals)base)
completers)util)
exceptions)log)
properties)named_configsc                       \ rS rSrSrSrg)BadConfigListInvocation   z5Exception for incorrect invocations of `config list`. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       lib/surface/config/list.pyr   r      s    =r   r   c                   r    \ rS rSrSrS\R                  R                  5       0r\	S 5       r
S rS rS rSrg	)
List"   a  List Google Cloud CLI properties for the currently active configuration.

{command} lists the properties of the specified section using the
active configuration. These include the account used to authorize access to
Google Cloud, the current Google Cloud project, and the default Compute Engine
region and zone, if set. See `gcloud topic configurations` for more about
configurations.

## AVAILABLE PROPERTIES

{properties}

## EXAMPLES

To list the set project property in the core section, run:

  $ {command} project

To list the set zone property in the compute section, run:

  $ {command} compute/zone

To list all the set properties in the compute section, run:

$ {command} compute/

To list all the properties in the compute section, run:

$ {command} compute/ --all

To list all the properties, run:

  $ {command} --all

Note, you cannot specify both `--all` and a property name. Only a section name
and the `--all` flag can be used together in the format `gcloud config list
<SECTION>/ --all`.
r   c                 P   U R                  SSSS9  U R                  SSS[        R                  SS	9  [        R                  R                  U 5        [        R                  R                  U 5        U R                  R                  S
5        U R                  R                  S5        g)zAdds args for this command.z--all
store_truez;List all set and unset properties that match the arguments.)actionhelppropertyzSECTION/PROPERTY?zhProperty to be listed. Note that SECTION/ is optional while referring to properties in the core section.)metavarnargs	completerr   configN)
add_argumentr   PropertiesCompleterr   PAGE_SIZE_FLAGRemoveFromParserURI_FLAGdisplay_info	AddFormatAddCacheUpdater)parsers    r   Args	List.ArgsM   s     J  L "007  8 	((0MM""6*
!!(+
''-r   c                    [         R                  " UR                  5      u  p#U(       a@  UU[         R                  R	                  U5      R                  U5      R                  5       00$ U(       a8  U[         R                  R	                  U5      R                  UR                  S90$ [         R                  R                  UR                  S9$ )z"List available regular properties.)
list_unset)	r   ParsePropertyStringr    VALUESSectionPropertyGet	AllValuesall)selfargssectionprops       r   _GetPropertiesToDisplayList._GetPropertiesToDisplay`   s    224==AMG
J%%--g6??EIIK 
 
''0::dhh:O  &&$((&;;r   c                 L   [         R                  " UR                  5      u  p#UR                  (       a  U(       a  [	        S5      e[         R
                  R                  R                  R                  5       nU(       a  [        R                  " U5        U R                  U5      $ )NzrCommands with the `--all` flag must be in the format `gcloud config list <SECTION>/` without a property specified.)r   r3   r    r9   r   r4   coreprojectr7   projects_util/CheckAndPrintEnvironmentTagMessageWithProjectIDr>   )r:   r;   _r=   
project_ids        r   RunList.Runq   s}    ,,T]];GAxxD#B 
 ""''//335JCC
 ''--r   c                     [         R                  R                  5       R                  n[        R
                  R                  SR                  U5      5        g )Nz%
Your active configuration is: [{0}]
)r   ConfigurationStoreActiveConfignamer
   statuswriteformat)r:   resources_were_displayedconfig_names      r   EpilogList.Epilog   s<    22??AFFKJJ188Er   r   N)r   r   r   r   r   r   r4   GetHelpStringdetailed_helpstaticmethodr/   r>   rG   rR   r   r   r   r   r   r   "   sD    %N  !2!2!@!@!BC-. .$<". r   r   N)r   
__future__r   r   r   googlecloudsdk.callioper   !googlecloudsdk.command_lib.configr   #googlecloudsdk.command_lib.projectsr   rC   googlecloudsdk.corer	   r
   r   "googlecloudsdk.core.configurationsr   Errorr   UniverseCompatibleListCommandr   r   r   r   <module>r`      sd    " &  ' ( 8 E * # * <>j.. > b4 b br   