
                             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\R                  5      rg)z:The command to list installed/available gcloud components.    )absolute_import)division)unicode_literals)base)
exceptions)log)
properties)	snapshots)update_managerc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Add   z1Add a new Trusted Tester component repository.
  a            Add a new Trusted Tester component repository to the list of
          repositories used by the component manager.  This will allow you to
          install and update components found in this repository.

          If you are participating in a Trusted Tester program, you will be
          instructed on the location of repositories with additional versions of
          one or more Google Cloud CLI components.
      z          To add the Trusted Tester component repository
          http://repo.location.com run:

            $ gcloud components repositories add http://repo.location.com
      )DESCRIPTIONEXAMPLESc                 (    U R                  SSSSS9  g )Nurl+URLz@One or more URLs for the component repositories you want to add.)nargsmetavarhelp)add_argument)parsers    *lib/surface/components/repositories/add.pyArgsAdd.Args3   s"    
O	  Q    c           	      R   UR                    H"  n [        R                  R                  USS9  M$     [        R                  R                  5       n/ n/ nUR                    H,  nXc;   a  UR                  U5        M  UR                  U5        M.     UR                  U5        [        R                  " [        R                  R                   R"                  SR%                  U5      [        R&                  R(                  S9  U H/  n[*        R,                  R/                  SR                  US95        M1     U H/  n[*        R,                  R/                  S	R                  US95        M1     U$ ! [        R                   a%    [
        R                  " SSR                  US95      ef = f)
zRuns the add command.zcomponents.repositories.add)command_pathr   zThe given repository [{repo}] could not be fetched. Check your network settings and ensure that you have entered a valid repository URL.)repo,)scopezAdded repository: [{repo}]z,Repository already added, skipping: [{repo}])r   r
   ComponentSnapshotFromURLsErrorr   InvalidArgumentExceptionformatr   UpdateManagerGetAdditionalRepositoriesappendextendr	   PersistPropertyVALUEScomponent_manageradditional_repositoriesjoinScopeINSTALLATIONr   statusPrint)selfargsr    reposaddedexistingr   s          r   RunAdd.Run;   sj    1##,,< 	- 	>  ((BBDEEHxx	S	 
 
LL++CC++-
 	jj3:::DE 	jj
8
?
?S
?
IK  L7 __ 111$f$f/	1 	11s   E--9F& N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r:   __static_attributes__r<   r   r   r   r      s3    

-$ Q Q#r   r   N)rA   
__future__r   r   r   googlecloudsdk.callioper   r   googlecloudsdk.corer   r	   googlecloudsdk.core.updaterr
   r   SilentCommandr   r<   r   r   <module>rJ      s:     A &  ' ( . # * 1 6@$

 @r   