
    C                         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  \R                    " S S\R"                  5      5       rg)z0The command to install/update gcloud components.    )absolute_import)division)unicode_literals)base)util)log)
properties)
console_io)OptInPrompterc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Update"   zUpdate all of your installed components to the latest version.

Ensure that the latest version of all installed components is installed on the
local workstation.
a  
          {description}

          The command lists all components it is about to update, and asks for
          confirmation before proceeding.

          By default, this command will update all components to their latest
          version. This can be configured by using the `--version` flag to
          choose a specific version to update to. This version may also be a
          version older than the one that is currently installed, thus allowing
          you to downgrade your Google Cloud CLI installation.

          You can see your current Google Cloud CLI version by running:

            $ {top_command} version

          To see the latest version of the Google Cloud CLI, run:

            $ {parent_command} list

          If you run this command without the `--version` flag and you already
          have the latest version installed, no update will be performed.
      z
          To update all installed components to the latest version:

            $ {command}

          To update all installed components to a fixed Google Cloud CLI version
          1.2.3:

            $ {command} --version=1.2.3
      )DESCRIPTIONEXAMPLESc           	      r    U R                  SSS9  U R                  SSSSSS	9  U R                  S
SSSSSS9  g )Nz	--versionzAn optional Google Cloud CLI version to update your components to. By default, components are updated to the latest available version. By selecting an older version you can downgrade your Google Cloud CLI installation.)helpcomponent_idszCOMPONENT-IDS*TzTHIS ARGUMENT NEEDS HELP TEXT.)metavarnargshiddenr   z--compile-pythonFTrue
store_true)requiredr   defaultactionr   )add_argument)parsers     lib/surface/components/update.pyArgsUpdate.ArgsM   sh    
   -  / -  /    c                 X   [         R                  R                  R                  R	                  5       S;   a  [        5       R                  5         [        R                  " U5      nUR                  (       ar  UR                  (       da  [        R                  " SR                  SR                  UR                  5      S9SSSSS9nU(       a  UR                  UR                  5        g[         R"                  R%                  S	5        UR'                  UR                  UR                  S
9  g)zRuns the list command.)NTzYou have specified individual components to update.  If you are trying to install new components, use:
  $ gcloud components install {components} )
componentsz"Do you want to run install insteadF)messageprompt_stringr   throw_if_unattendedcancel_on_noNz8Beginning update. This process may take several minutes.)version)r	   VALUEScoredisable_usage_reportingGetBoolr   Promptr   GetUpdateManagerr   r*   r
   PromptContinueformatjoinInstallr   statusPrintr   )selfargsupdate_managerinstalls       r   Run
Update.Runc   s    55==?<Oo**40N$,,)),,2F$"4"45 -3 -7<#g 
t112JJOP$,,dllCr"    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr    r;   __static_attributes__r=   r"   r   r   r   "   s3    
.	
1"-H / /*Dr"   r   N)rB   
__future__r   r   r   googlecloudsdk.callioper   %googlecloudsdk.command_lib.componentsr   googlecloudsdk.corer   r	   googlecloudsdk.core.consoler
   &googlecloudsdk.core.util.prompt_helperr   UniverseCompatibleSilentCommandr   r=   r"   r   <module>rN      sT     7 &  ' ) 6 # * 2 @ TDT TD TDr"   