
                             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
\R                  5      rg)z'Command to list the available accounts.    )absolute_import)division)unicode_literals)base)log)
properties)storec                   4    \ rS rSrSr\S 5       rS rS rSr	g)List   as  Lists credentialed accounts.

Lists accounts whose credentials have been obtained using `gcloud init`,
`gcloud auth login` and `gcloud auth activate-service-account`, and shows
which account is active. The active account is used by gcloud and other Google
Cloud CLI tools to access Google Cloud Platform. While there is no limit on
the number of accounts with stored credentials, there is only one active
account.

## EXAMPLES

To set an existing account to be the current active account, run:

  $ gcloud config set core/account your-email-account@gmail.com

If you don't have an existing account, create one using:

  $ gcloud init

To list the active account name:

  $ gcloud auth list --filter=status:ACTIVE --format="value(account)"

To list the inactive account names with prefix `test`:

  $ gcloud auth list --filter="-status:ACTIVE account:test*" --format="value(account)"
c                 b    [         R                  R                  U 5        U R                  SSS9  g )Nz--filter-accountz        List only credentials for one account. Use
        --filter="account~_PATTERN_" to select accounts that match
        _PATTERN_.)help)r   URI_FLAGRemoveFromParseradd_argument)parsers    lib/surface/auth/list.pyArgs	List.Args;   s/    MM""6*
      c                    [         R                  " 5       nUR                  (       a.  U Vs/ s H!  nUR                  UR                  :X  d  M  UPM#     nnSnU HC  nUR                  [
        R                  R                  R                  R                  :w  d  MA  Sn  O   U(       a/  UR                  5       R                  [         R                  5        U$ U Vs/ s H.  n[         R                  " UR                  UR                  5      PM0     nnUR                  5       R                  [         R                  5        U$ s  snf s  snf )a  Run the 'gcloud auth list' command to list the accounts.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation (i.e. group and command arguments combined).

Returns:
  [googlecloudsdk.core.credentials.store.AcctInfo] or
    [googlecloudsdk.core.credentials.store.AcctInfoWithUniverseDomain]: A
    list of AcctInfo objects if all accounts are from googleapis.com,
    otherwise a list of AcctInfoWithUniverseDomain objects.
FT)c_storeAllAccountsWithUniverseDomainsfilter_accountaccountuniverse_domainr   VALUEScoredefaultGetDisplayInfo	AddFormat)ACCOUNT_TABLE_WITH_UNIVERSE_DOMAIN_FORMATAcctInfostatusACCOUNT_TABLE_FORMAT)selfargsaccount_info_listaccount_infoshow_universe_domains        r   RunList.RunE   s/     >>@ 0/l!!T%8%88 /   !)

&
&##33;;<  $ * 
%%

;
;  0/l 

<//1D1D
E/  
 %%g&B&BC?0s   E E 5Ec                     U(       a   [         R                  R                  S5        g [         R                  R                  S5        g )NzK
To set the active account, run:
    $ gcloud config set account `ACCOUNT`
zK
No credentialed accounts.

To login, run:
  $ gcloud auth login `ACCOUNT`
)r   r$   Print)r&   resources_were_displayeds     r   EpilogList.Epilogu   s5    	jj  
 
jj  r    N)
__name__
__module____qualname____firstlineno____doc__staticmethodr   r+   r0   __static_attributes__r2   r   r   r   r      s&    :  .`r   r   N)r7   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.corer   r   googlecloudsdk.core.credentialsr	   r   ListCommandr   r2   r   r   <module>r?      s3     . &  ' ( # * <e4 er   