o
    :Fd                     @   s   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mZmZmZmZ d dlmZ d dlmZ d d	lZd d	lZd
Zdd Zd	S )    )cli_util)Document)ThreadedCompleter)BottomToolbar)OciShellCompleter)AUTHENTICATION_PARAMSAUTO_PROMPT_PARAMSDEBUG_PARAMSOCI_CLI_DISABLE_COLORS_ENV_VARprint_suggestion_message)override_key_binding)create_oci_prompt_sessionNz	--profilec                 C   s  t   tjdd  }g }tD ]}||v r*||}||||d  7 }|||d = qg }tD ]}||v rD||}||| g7 }||= q/ddd |D }| jd }d | jd< t|t	|}t
|  d}	ttjv rnd}	t }
t|	|
}t| |	|
d	}t||
d
}t|}|j|||d}|rd| nd}dtjt
j< |rdd| d d| | d | nd}t| v rtd d S t| d S )N       c                 S   s   g | ]}|t vr|qS  )r   ).0argr   r   ?usr/lib/python3.10/site-packages/interactive/cli_interactive.py
<listcomp>0   s    z+start_interactive_shell.<locals>.<listcomp>endpointTF)Zbottom_toolbar)	completertoolbar)r   defaultZkey_bindingsz --endpoint  Truezoci zH--profile param should be provided before entering into interactive mode)r   sysargvr   indexr	   joinobjr   lenr   Z/create_config_and_signer_based_on_click_contextr
   osenvironr   r   r   r   r   promptZOCI_CLI_IN_INTERACTIVE_MODEPROFILE_PARAMsplitprintsystem)ctx	argumentsZauth_paramsparamZ	param_idxZdebug_paramsZcommand_before_promptr   ZdocumentZcolors_enabledr   Zsessionr   ZkbZmultithread_completertextZendpoint_strcommandr   r   r   start_interactive_shell   st   







r.   )oci_clir   Zprompt_toolkit.documentr   Zprompt_toolkit.completionr   Zinteractive.bottom_toolbarr   Zinteractive.oci_shell_completerr   Zinteractive.utilsr   r   r	   r
   r   Zinteractive.key_bindingsr   Zinteractive.prompt_sessionr   r"   r   r%   r.   r   r   r   r   <module>   s   