
                             d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 d	 Zej                   G d
 dej                               Zy)zCUpdates non-gcloud CLI command trees in the installation directory.    )absolute_import)division)unicode_literals)arg_parsers)base)cli_tree)generate_cli_treesc            	          dj                  t        t        j                  gt	        t
        j                  j                               z               S )Nz, )joinsortedr   DEFAULT_CLI_NAMElistr	   
GENERATORSkeys     $lib/surface/meta/cli_trees/update.py_GetCliTreeGeneratorListr      sD    	$$
%#..33567
 r   c                   .    e Zd ZdZdeiZed        Zd Zy)UpdateaD  Updates gcloud CLI command trees in the installation directory.

  A CLI tree is a module or JSON file that describes a command and its
  subcommands, flags, arguments, help text and TAB completers.
  *gcloud interactive* uses CLI trees for typeahead, command line completion,
  and as-you-type documentation.

  Most CLI tree files are cached in the *cli* subdirectory of the *gcloud*
  installation root directory. The cache is automatically updated by the
  Cloud SDK installers and the *gcloud components* command group.

  These CLIs are currently supported: {generators}.
  
generatorsc                     | j                  dt        j                         dd       | j                  dd       | j                  dd	d
       | j                  dd       | j                  dd	dd       y )Nz
--commandsCOMMANDz&Update only the commands in this list.)typemetavarhelpz--directoryzDUpdate this directory instead of the default installation directory.)r   z--force
store_truezOForce existing CLI trees to be out of date. This causes them to be regenerated.)actionr   z	--tarballzFor packaging CLI trees. --commands specifies one command that is a relative path in this tarball. The tarball is extracted to a temporary directory and the command path is adjusted to point to the temporary directory.z--skip-completionsFz-Skip updating the static completion CLI tree.)r   defaultr   )add_argumentr   ArgList)parsers    r   ArgszUpdate.Args7   s    
  "5	      !	   <   <	  r   c           	          t        j                  | j                  |j                  |j                  |j
                  |j                  |j                   |j                         y )N)clicommands	directorytarballforceverboseskip_completions)	r	   UpdateCliTrees_cli_power_users_onlyr&   r'   r(   r)   quietr+   )selfargss     r   Runz
Update.Run^   sG    %%&&..jjJJ..r   N)	__name__
__module____qualname____doc__r   detailed_helpstaticmethodr#   r1   r   r   r   r   r   %   s,      !9:-$ $L	r   r   N)r5   
__future__r   r   r   googlecloudsdk.callioper   r   r   googlecloudsdk.command_lib.metar	   r   UniverseCompatibleCommandr   r   r   r   <module>r=      sM     J &  ' / ( , > AT\\ A Ar   