
    C                     "   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	iZd
 Zej                   ej                  ej                  j                   ej                  j"                         G d dej$                                      Zy)z)Start the Spanner command-line interface.    )base)cli_backend)flags)resource_args)	arg_utils)
propertiesEXAMPLESz      To start an interactive shell with your Spanner example database, run the following command:

        $ {command} example-database --instance=example-instance
    c                    t        j                  | d       t        j                         j	                  |        t        j
                         j	                  |        t        j                         j	                  |        t        j                         j	                  |        t        j                         j	                  |        t        j                         j	                  |        t        j                         j	                  |        t        j                         j	                  |        t        j                         j	                  |        t        j                         j	                  |        t        j                         j	                  |        t        j                         j	                  |        t        j                          j	                  |        t        j"                         j	                  |        t        j$                         j	                  |        t        j&                         j	                  |        t        j(                         j	                  |        y)zeParses provided arguments to add base arguments.

  Args:
    parser: an argparse argument parser.
  z#to use within the interactive shellN)r   AddDatabaseResourceArgr   GetSpannerCliDatabaseRoleFlagAddToParserGetSpannerCliDelimiterFlagGetSpannerCliExecuteFlagGetSpannerCliHostFlagGetSpannerCliHtmlFlag'GetSpannerCliIdleTransactionTimeoutFlagGetSpannerCliInitCommandAddFlagGetSpannerCliInitCommandFlagGetSpannerCliPortFlagGetSpannerCliPromptFlag GetSpannerCliSkipColumnNamesFlag"GetSpannerCliSkipSystemCommandFlagGetSpannerCliSystemCommandFlagGetSpannerCliSourceFlagGetSpannerCliTableFlagGetSpannerCliTeeFlagGetSpannerCliXmlFlagparsers    lib/surface/spanner/cli.pyAddBaseArgsr!   "   s    &&3 %%'33F;""$008  "..v6++F3++F3//1==fE'')55f=$$&226:++F3!--f5((*66v>**,88@&&(44V<!--f5 ,,V4**62**62    c                   *    e Zd ZdZeZed        Zd Zy)Cliz!An interactive shell for Spanner.c                     t        |        y)zSee base class.N)r!   r   s    r    ArgszCli.ArgsE   s     r"   c                 j   t        j                  |dd      }|j                  j                  j	                         j                         j                         }t        j                  j                  j                  d      j                         }t        j                         }t        j                         } |di d|d|j                  d|d|j                  d	|j                   d
|j"                  d|d|j$                  d|j&                  d|j(                  d|j*                  d|j,                  d|j.                  d|j0                  d|j2                  d|j4                  d|j6                  d|j8                  d|j:                  d|j<                  d|j>                  d| y )Nz	--projectT)use_defaultsspannerprojectdatabaseinstancedatabase_rolehostportapi_endpointidle_transaction_timeoutskip_column_namesskip_system_commandsystem_commandprompt	delimitertablehtmlxmlexecutesourceteeinit_commandinit_command_addenv ) r   GetFromNamespaceCONCEPTSr+   ParseParentNamer   VALUESapi_endpoint_overridesPropertyGetr   SpannerCliWrapperGetEnvArgsForCommandr-   r.   r/   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   )selfargsr*   r,   api_endpoint_overridecommand_executorenv_varss          r    RunzCli.RunJ   s   (({NG}}%%++-446;;=H&--DDMM	ce 
 #446//1H   ((	
 YY YY + "&!>!> 00 !44 ** {{ .. jj YY  HH!" #$ {{%& HH'( &&)* ..+, -0 	r"   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr&   rQ   r@   r"   r    r$   r$   >   s#     *- "	r"   r$   N)rU   googlecloudsdk.callioper   "googlecloudsdk.command_lib.spannerr   r   r   $googlecloudsdk.command_lib.util.apisr   googlecloudsdk.corer   rV   r!   DefaultUniverseOnlyReleaseTracksReleaseTrackALPHAGABinaryBackedCommandr$   r@   r"   r    <module>rc      s    0 ( : 4 < : *  38 D%%++T->->-A-AB,	$
"
" ,	 C ,	r"   