File: //opt/saltstack/salt/lib/python3.10/site-packages/relenv/__pycache__/create.cpython-310.pyc
o
�N�gZ � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z m
Z
mZmZ ej
dd� �ZG dd � d e �Zd
d� Zddd
�Zdd� ZdS )z
The ``relenv create`` command.
� N� )�platform_versions)�RelenvException�arches�archived_build�
build_archc c s8 � t �� }zt �| � dV W t �|� dS t �|� w )z�
Context manager that changes to the specified directory and back.
:param path: The path to temporarily change to
:type path: str
N)�os�getcwd�chdir)�path�cwd� r
�A/opt/saltstack/salt/lib/python3.10/site-packages/relenv/create.pyr
s �
r
c @ s e Zd ZdZdS )�CreateExceptionzJ
Raised when there is an issue creating a new relenv environment.
N)�__name__�
__module__�__qualname__�__doc__r
r
r
r r ! s r c C sd | j ddd�}|jtd� |jddd� |jdt� ttj td d
� |jdt � d t � td
d
� dS )z�
Setup the subparser for the ``create`` command.
:param subparsers: The subparsers object returned from ``add_subparsers``
:type subparsers: argparse._SubParsersAction
�createzrCreate a Relenv environment. This will create a directory of the given name with newly created Relenv environment.)�description)�func�namez#The name of the directory to create)�helpz--archz,The host architecture [default: %(default)s])�default�choices�typer z--pythonr z)The python version [default: %(default)s]N)
�
add_parser�set_defaults�main�add_argumentr r �sys�platform�strr )Z
subparsersZ subparserr
r
r �setup_parser'