
                         Z    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Z	ddZ
d	 Zy
)zFlags for OS Login subcommands.    )absolute_import)division)unicode_literals)arg_parsers)filesc                     | j                  d      }|j                  ddj                  ||             |j                  ddj                  ||             y)	z4Adds --key and --key-file flags to oslogin commands.T)requiredz--keyzG          The SSH public key to {0} the OS Login Profile.{1}
          )helpz
--key-filezn          The path to a file containing an SSH public key to {0} the
          OS Login Profile.{1}
          N)add_mutually_exclusive_groupadd_argumentformat)parseractionadditional_helpkey_args       /lib/googlecloudsdk/command_lib/oslogin/flags.pyAddKeyFlagsr      sg    ///>'	fV_-	  / 
 fV_-  /    c                 R    | j                  dt        j                         |d       y )Nz--ttlaO            The amount of time before the SSH key expires. For example,
          specifying ``30m'' will set the expiration time on the SSH key for
          30 minutes from the current time. A value of 0 will result in no
          expiration time.
          See $ gcloud topic datetimes for information on duration formats.
          )typer	   r
   )r   r   Duration)r   r	   s     r   
AddTtlFlagr   +   s,    !	  
r   c                 x    | j                   r!t        j                  | j                         }|S | j                  }|S )N)key_filer   ReadFileContentskey)argsr   s     r   GetKeyFromArgsr   9   s4    	]]

 
 
/C 
* ((C	*r   N) )F)__doc__
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.core.utilr   r   r   r    r   r   <module>r%      s(    & &  ' / */$r   