HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //usr/lib/google-cloud-sdk/lib/surface/__pycache__/interactive.cpython-312.pyc
�

���)���dZddlmZddlmZddlmZddlZddlZddlmZddlm	Z	ddl
mZddl
mZdd	l
mZdd
l
mZddlmZddlmZddlZej,rdd
l
mZddl
mZdZdZd�Zd�Zd�Zej<ej>j@ej>jB�Gd�dejD��Z#y)z;Extensible interactive shell with auto completion and help.�)�absolute_import)�division)�unicode_literalsN)�base)�cli_tree)�config)�
exceptions)�
properties)�render_document)�encoding)�application)�bindingsz|
* auto-completion and active help for all commands
* state preservation across commands: *cd*, local/environment variables
a�
# Welcome to the gcloud interactive shell environment.

Tips:

* start by typing commands to get auto-suggestions and inline help
* use `tab`, `up-arrow`, or `down-arrow` to navigate completion dropdowns
* use `space` or `/` to accept the highlighted dropdown item
* run gcloud <alpha|beta> interactive --help for more info

Run *$ gcloud feedback* to report bugs or request new features.

c���tjjjj	�xsd}|r|dz
}||z
}tjtjd|�y)aAppends tag to the Cloud SDK metrics environment tag.

  The metrics/environment tag is sent via the useragent. This tag is visible in
  metrics for all gcloud commands executed by the calling command.

  Args:
    tag: The string to append to the metrics/environment tag.
  ��.�CLOUDSDK_METRICS_ENVIRONMENTN)	r
�VALUES�metrics�environment�Getr�SetEncodedValue�os�environ)�tag�metrics_environments  �lib/surface/interactive.py�_AppendMetricsEnvironmentr?s]��#�)�)�1�1�=�=�A�A�C�I�r����3�������
���2�:�:�'E�.�0�c�<�tjryg}tj�jD]X}|j	d��}|s�|jdj
|jd����|j|��Zdj|�S)z0Returns the function key bindings help markdown.rT)�markdownz
{}:::�
)	�six�PY2r�KeyBindings�GetHelp�append�format�GetLabel�join)�lines�key�	help_texts   r�_GetKeyBindingsHelpr-Ps|���W�W�
�
�%�
�
!�
!�
#�
,�
,�c����T��*�I���l�l�9�#�#�C�L�L�$�L�$?�@�A��l�l�9��	-�

���5�	�rc�H�g}ttjjd���D]�}|js�|jdj
|j��|j|j�|j}|��dt|tj�rdj
|�}n8|dvr#tj|�j�}dj
|�}|jdj
|����dj|�S)	z%Returns the properties help markdown.c��|jS)N)�name)�ps r�<lambda>z$_GetPropertiesHelp.<locals>.<lambda>`s��!�&�&r)r+z
*{}*::z"{}")FTz*{}*zThe default value is {}.r!)�sortedr
r�interactiver,r&r'r0�default�
isinstancer"�string_types�	text_type�lowerr))r*�propr5s   r�_GetPropertiesHelpr;]s���
�%��Z�&�&�2�2�8H�I�d��~�~��l�l�:�$�$�T�Y�Y�/�0��l�l�4�>�>�"����g�	�	��g�s�/�/�0��M�M�'�*�'�
�
�
%��m�m�G�,�2�2�4�G��M�M�'�*�'�
���/�6�6�w�?�@�J�
���5�	�rc�2�eZdZdZeeed�Zed��Z	d�Z
y)�Interactivea�Start the gcloud interactive shell.

  *{command}* provides an enhanced *bash*(1) command line with features that
  include:
  {features}

  ### Display

  The *{command}* display window is divided into sections, described here
  from top to bottom.

  *Previous Output*::

  Command output scrolls above the command input section as commands are
  executed.

  *Command Input*::

  Commands are typed, completed, and edited in this section. The default prompt
  is "$ ". If a context has been set, then its tokens are prepopulated before
  the cursor.

  *Active Help*::

  As you type, this section displays in-line help summaries for commands, flags,
  and arguments. You can toggle active help on and off via the *F2* key.
  Hit *F8* to display the help text in your browser.

  *Status Display*::

  Current *gcloud* project and account information, and function key
  descriptions and settings are displayed in this section. Function keys
  toggle mode/state settings or run specific actions.
  {bindings}

  ### Auto and Tab Completion

  Command completions are displayed in a scrolling pop-up menu. Use `tab` and
  up/down keys to navigate the completions, and `space` or `/` to select the
  highlighted completion.

  Completions for _known_ commands, flags, and static flag values are displayed
  automatically. Positional and dynamic flag value completions for known
  commands are displayed after `tab` is entered. Known commands include
  `gcloud`, `bq`, `gsutil`, `kubectl`, and any command with a man page that has
  been executed at least once in any *interactive* session.

  `tab` completion for unknown commands defers to *bash*(1), while still using
  the *interactive* user interface. Absent specific command information, a
  file/path completer is used when `tab` is entered for unknown positionals
  (arguments that do not start with '-'). The default completer handles '~' path
  notation and embedded _$var_ references, but does not expand their values in
  completions.

  Configure bash completions as you normally would. *{command}* starts up bash
  in a mode that sources *~/.bashrc* with the environment variable
  *COSHELL_VERSION* set to a non-empty version value.

  Command completion resets with each simple command in the command line. Simple
  commands are separated by '|', ';', '&' and may appear after '$(', '(', '{',
  '!', *if*, *then*, *elif*, *while*, and _name_=_value_ per command exports.
  Use `tab` on an empty line to enable command executable search on PATH for
  the first token in each simple command.

  Currently simple and compound commands must be entered in a single line.

  Refer to
  [Using gcloud interactive](https://cloud.google.com/sdk/docs/interactive-gcloud)
  for more information and animated GIFs.

  ### Control Characters

  Control characters affect the currently running command or the current
  command line being entered at the prompt.

  *ctrl-c*::
  If a command is currently running, then that command is interrupted. This
  terminates the command. Otherwise, if no command is running, ctrl-c clears
  the current command line.

  *ctrl-d*::
  Exits when entered as the first character at the command prompt. You can
  also run the *exit* command at the prompt.

  *ctrl-w*::
  If a command is not currently running, then the last word on the command
  line is deleted. This is handy for "walking back" partial completions.

  ### Command history

  *{command}* maintains persistent command history across sessions.

  #### emacs mode

  *^N*:: Move ahead one line in the history.
  *^P*:: Move back one line in the history.
  *^R*:: Search backwards in the history.

  #### vi mode

  /:: Search backwards in the history.
  *j*:: Move ahead one line in the history.
  *k*:: Move back one line in the history.
  *n*:: Search backwards for the next match.
  *N*:: Search forwards for the next match.

  #### history search mode

  *ENTER/RETURN*:: Retrieve the matched command line from the history.
  *^R*:: Search backwards for the next match.
  *^S*:: Search forwards for the next match.

  ### Layout Configuration

  Parts of the layout are configurable via
  *$ gcloud config set* interactive/_property_. These properties are only
  checked at startup. You must exit and restart to see the effects of new
  settings.
  {properties}

  ### CLI Trees

  *{command}* uses CLI tree data files for typeahead, command line completion,
  and help snippet generation. A few CLI trees are installed with their
  respective Google Cloud CLI components: *gcloud* (core component), *bq*,
  *gsutil*, and *kubectl*. Trees for commands that have man(1) pages are
  generated on the fly. See `$ gcloud topic cli-trees` for details.

  ## EXAMPLES

  To set the command context of *{command}* to "gcloud ", run:

      {command} --context="gcloud "

  ## NOTES

  On Windows, install *git*(1) for a *bash*(1) experience. *{command}* will
  then use the *git* (MinGW) *bash* instead of *cmd.exe*.

  Please run *$ gcloud feedback* to report bugs or request new features.
  )r�featuresr
c���|jdd��|jddddd��|jd	dddd
��|jddd�
�|jddddd��y)Nz	--contextz�Default command context. This is a string containing a command name, flags, and arguments. The context is prepopulated in each command line. You can inline edit any part of the context, or ctrl-c to eliminate it.)�helpz--debugT�
store_truezEnable debugging display.)�hidden�actionr5r@z--hiddenz/Enable completion of hidden commands and flags.z--promptzThe interactive shell prompt.)rBr@z	--suggestz_Enable auto suggestion from history. The defaults are currently too rudimentary for prime time.)�add_argument)�parsers r�ArgszInteractive.Argss���
����4��6��������
(��*��������
>��@������
,��.��������0��2rc� �tjrtjd��t	j
�j}|r"tj|jdd��|js-tjtjt���t!j"|j$|j&|j(|j*|j,��}t/d�t1j2||��y)NzCThis command does not support Python 2. Please upgrade to Python 3.F)�cli�force�verbose)�fin)�context�debugrB�prompt�suggest�interactive_shell)�argsr)r"r#r	�Error�
gcloud_config�Paths�sdk_rootr�Load�_cli_do_not_use_directly�quietr�RenderDocument�io�StringIO�_SPLASH�
configuration�ConfigrLrMrBrNrOrr
�main)�selfrQrUrs    r�RunzInteractive.Run's���
�w�w����4�
5�5��"�"�$�-�-�H���m�m��5�5�U�E�R��:�:��$�$����W�)=�>�
�
!�
!�����j�j��{�{��{�{�����F��1�2����$�v�.rN)�__name__�
__module__�__qualname__�__doc__r-�	_FEATURESr;�
detailed_help�staticmethodrFra�rrr=r=ps4��L�^&��&��-��2��2�>/rr=)$re�
__future__rrrrZr�googlecloudsdk.callioperr�&googlecloudsdk.command_lib.interactiverr]�googlecloudsdk.corerSr	r
�&googlecloudsdk.core.document_renderersr�googlecloudsdk.core.utilrr"�PY3r
rrfr\rr-r;�
ReleaseTracks�ReleaseTrack�ALPHA�BETA�Commandr=rirr�<module>rvs��� B�&��'�	�	�(�,�J�7�*�*�B�-�
��7�7�@�=�
�	�
��0�"
��&����D�%�%�+�+�T�->�->�-C�-C�D�I/�$�,�,�I/�E�I/r