
                         z    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	\R                  5      rg
)z:The command to list installed/available gcloud components.    )absolute_import)division)unicode_literals)base)util)logc                   :    \ rS rSrSr\S 5       rS rS rS r	Sr
g)	List   a  List the status of all Google Cloud CLI components.

This command lists all the available components in the Google Cloud CLI. For
each component, the command lists the following information:

* Status on your local workstation: not installed, installed (and
  up to date), and update available (installed, but not up to date)
* Name of the component (a description)
* ID of the component (used to refer to the component in other
  [{parent_command}] commands)
* Size of the component

## EXAMPLES
To list the status of all Google Cloud CLI components, run:

  $ {command}

To show the currently installed version (if any) and the latest available
version of each component, run:

  $ {command} --show-versions
c                    [         R                  R                  U 5        [         R                  R                  U 5        U R	                  SSSS9  U R	                  SSSSS9  U R	                  S	SSSS
S9  U R	                  SSSSS9  g )Nz--only-local-state
store_truez'Only show locally installed components.)actionhelpz--show-versionsFz8Show installed and available versions of all components.)requiredr   r   z--show-hiddenT)r   r   r   hiddenz--show-platformz8Show operating system and architecture of all components)r   PAGE_SIZE_FLAGRemoveFromParserURI_FLAGadd_argument)parsers    lib/surface/components/list.pyArgs	List.Args3   s    ((0MM""6*
6  
 E,G  I %G  
 G	  I    c                    SS/nUR                   (       a  / OS/nUR                  S5        UR                  (       a  UR                  SS/5        UR                  SS/5        UR                  (       a  UR                  S	S
/5        UR                  5       R                  SR                  SR                  U5      SR                  U5      S95        g )Nboxztitle="Components"zstate.name:label=Statuszname:label=Namez2current_version_string:label=Installed:align=rightz.latest_version_string:label=Latest:align=rightzid:label=IDz5size.size(zero="",min=1048576):label=Size:align=rightz+platform.architecture.id:label=ARCHITECTUREz3platform.operating_system.id:label=OPERATING_SYSTEMztable[{attributes}]({columns}),)
attributescolumns)	only_local_stateappendshow_versionsextendshow_platformGetDisplayInfo	AddFormatformatjoin)selfargsr   r   s       r   
_SetFormatList._SetFormatJ   s    
J ))b0I/JGNN$%nn
>
:  NN?
  nn
7
?  	##$D$K$K88J''1B %L %D Er   c                     U R                  U5        [        R                  " U5      nUR                  UR                  UR
                  S9nUu  o@l        U l        U$ )zRuns the list command.)show_hiddenr    )r+   r   GetUpdateManagerr
   r.   r    _current_version_latest_version)r)   r*   update_managerresultto_prints        r   RunList.Runb   sZ    OOD**40N  T-=-=262G2G ! IF>D;X$d&:Or   c                    U(       d  [         R                  R                  S5        U R                  c  SOSR	                  U R                  5      n[         R                  R                  SR	                  U R
                  US95        g )Nz
No updates. z [{}]a   To install or remove components at your current Google Cloud CLI version [{current}], run:
  $ gcloud components install COMPONENT_ID
  $ gcloud components remove COMPONENT_ID

To update your Google Cloud CLI installation to the latest version{latest}, run:
  $ gcloud components update

)currentlatest)r   statuswriter1   r'   r0   )r)   resources_were_displayedlatest_version_strings      r   EpilogList.Epilogk   sk    #	jj'#'#7#7#?R")..1E1E"F JJ  F4((1FFGIr   )r0   r1   N)__name__
__module____qualname____firstlineno____doc__staticmethodr   r+   r5   r?   __static_attributes__ r   r   r
   r
      s.    . I I,E0Ir   r
   N)rE   
__future__r   r   r   googlecloudsdk.callioper   %googlecloudsdk.command_lib.componentsr   googlecloudsdk.corer   ListCommandr
   rH   r   r   <module>rN      s3     A &  ' ( 6 #]I4 ]Ir   