
    wBfy                    p    d Z ddlmZ ddlmZ ddlmZ ddlmZ er
ddlm	Z	m
Z
mZ  ee      Zd
dZddZy	)z|CLI implementation for `conda init`.

Prepares the user's profile for running conda, and sets up the conda shell interface.
    )annotations)SUPPRESS)	getLogger)TYPE_CHECKING)ArgumentParser	Namespace_SubParsersActionc           
        ddl m} ddlm} ddlm} ddlm} ddlm	} d}|} |d	      }	 | j                  	 d/|||	d
|}
|
j                  ddt        |       |
j                  ddd|       |
j                  d      }|j                  ddt        |       |j                  ddddd       |j                  dddd       |j                  ddd|       |j                  ddd|       |
j                  dd |d!d"t        |       |rd#d$gnd%g&       |r|
j                  d'dd(|        ||
       |
j                  d)d*dd+,       |
j                  d-.       |
S )0N   )dalsCOMPATIBLE_SHELLSon_win)NULL   )add_parser_jsonz'Initialize conda for shell interaction.a9  
        Key parts of conda's functionality require that it interact directly with the shell
        within which conda is being invoked. The `conda activate` and `conda deactivate` commands
        specifically are shell-level commands. That is, they affect the state (e.g. environment
        variables) of the shell context being interacted with. Other core commands, like
        `conda create` and `conda install`, also necessarily interact with the shell environment.
        They're therefore implemented in ways specific to each shell. Each shell must be configured
        to make use of them.

        This command makes changes to your system that are specific and customized for each shell.
        To see the specific files and locations on your system that will be affected before, use
        the '--dry-run' flag.  To see the exact changes that are being or will be made to each
        location, use the '--verbose' flag.

        IMPORTANT: After running `conda init`, most shells will need to be closed and restarted for
        changes to take effect.

        )helpdescriptionepilogz--dev
store_true)actionr   defaultz--allz*Initialize all currently available shells.z
setup typez	--installz--useruserz0Initialize conda for the current user (default).T)r   destr   r   z	--no-userstore_falsez,Don't initialize conda for the current user.)r   r   r   z--systemz-Initialize conda for all users on the system.z	--reversez Undo effects of last conda init.shells*SHELLSzOne or more shells to be initialized. If not given, the default value is 'bash' on unix and 'cmd.exe' & 'powershell' on Windows. Use the '--all' flag to initialize all shells. Available shells: zcmd.exe
powershellbash)nargschoicesmetavarr   r   z--anaconda-promptz.Add an 'Anaconda Prompt' icon to your desktop.z-dz	--dry-runz'Only display what would have been done.)r   r   zconda.cli.main_init.execute)func)init)
auxlib.ishr   base.constantsr   common.compatr   common.constantsr   helpersr   
add_parseradd_argumentr   add_argument_groupsortedset_defaults)sub_parserskwargsr   r   r   r   r   summaryr   r   psetup_type_groups               3lib/python3.12/site-packages/conda/cli/main_init.pyconfigure_parserr7      s   !2&'(7GK	F* 				
 	A NN	   NN9	   ++L9!!	 "  !!? "  !!;	 "  !!<	 "  !!/	 "  NN!))/0A)B(CE .4L)&   	A	 	 	
 ANN6	   NN5N6H    c                   ddl m} ddlm} ddlm} ddlm}m}m	} ddl
m} | j                  r ||j                        S | j                  r|}	nt        | j                        }	| j                   r!t#        |	      dk7  r |d       ||	d	         S | j$                  xr | j&                   }
|xr | j(                  } ||j                  |	|
| j&                  || j*                        S )
Nr   r   )contextr   )
initializeinitialize_devinstall)ArgumentErrorr   z3--dev can only handle one shell at a time right nowr   )r(   r   base.contextr:   r)   r   core.initializer;   r<   r=   
exceptionsr>   conda_prefixalltupler   devlenr   systemanaconda_promptreverse)argsparserr   r:   r   r;   r<   r=   r>   selected_shellsfor_userrH   s               r6   executerN      s    2&&EE*||w++,, xx+,xx1$ UVVoa011 990T[[ 9T%9%9  KKLL
 	
r8   N)r1   r	   returnr   )rJ   r   rK   r   rO   int)__doc__
__future__r   argparser   loggingr   typingr   r   r   r	   __name__logr7   rN    r8   r6   <module>rY      s7   
 #    EEsl
r8   