ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib64/python3.11/site-packages/semver/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/semver/__pycache__/cli.cpython-311.pyc

�

�܋fE���dZddlZddlZddlmZmZmZddlmZddl	m
Z
dejdefd	�Z
dejddfd
�Zdejdefd�Zdejdefd�Zdejfd
�Zdejdefd�Zddeeedefd�ZdS)ac
CLI parsing for :command:`pysemver` command.

Each command in :command:`pysemver` is mapped to a ``cmd_`` function.
The :func:`main <semver.cli.main>` function calls
:func:`createparser <semver.cli.createparser>` and
:func:`process <semver.cli.process>` to parse and process
all the commandline options.

The result of each command is printed on stdout.
�N)�cast�List�Optional�)�Version)�__version__�args�returnc��dddddd�}|j�|j�dd	g��tj|j��}t
||tt|j����}t|����S)
z�
    Subcommand: Bumps a version.

    Synopsis: bump <PART> <VERSION>
    <PART> can be major, minor, patch, prerelease, or build

    :param args: The parsed arguments
    :return: the new, bumped version
    �
bump_major�
bump_minor�
bump_patch�bump_prerelease�
bump_build)�major�minor�patch�
prerelease�buildN�bumpz-h)	r�parser�
parse_argsr�parse�version�getattrr�str)r	�maptable�ver�funcs    �[/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/semver/cli.py�cmd_bumpr!s������'����H��y��	
������~�.�.�.�
�-���
%�
%�C��3���c�4�9�!5�!5�6�7�7�D��t�t�v�v�;�;��c�f�tj|j��rdStd|jz���)z�
    Subcommand: Checks if a string is a valid semver version.

    Synopsis: check <VERSION>

    :param args: The parsed arguments
    NzInvalid version %r)r�is_validr�
ValueError�r	s r �	cmd_checkr'1s4������%�%���t�
�)�D�L�8�
9�
9�9r"c��tj|j��}t|�|j����S)z
    Subcommand: Compare two versions.

    Synopsis: compare <VERSION1> <VERSION2>

    :param args: The parsed arguments
    )rr�version1r�compare�version2)r	�ver1s  r �cmd_comparer->s1���=���'�'�D��t�|�|�D�M�*�*�+�+�+r"c��tj|j��}t|�|j����S)z�
    Subcommand: Determines the next version, taking prereleases into account.

    Synopsis: nextver <VERSION> <PART>

    :param args: The parsed arguments
    )rrrr�next_version�part)r	rs  r �cmd_nextverr1Js3���m�D�L�)�)�G��w�#�#�D�I�.�.�/�/�/r"c�f�tjtt���}|�dddt
z���|���}|�dd���}|�t�	��|�d
d���|�dd
���|�dd���}|�t�	��|�dd���}|�dd���|�dd���|�dd���|�dd���|�dd���fD]}|�dd����|�dd���}|�t�	��|�dd���|�d d!���}|�t�	��|�dd���|�d"d#���|S)$z\
    Create an :class:`argparse.ArgumentParser` instance.

    :return: parser instance
    )�prog�descriptionz	--versionrz	%(prog)s )�actionrr*zCompare two versions)�help)rr)z
First versionr+zSecond versionrzBumps a versionz
Bump commands)�title�destrz"Bump the major part of the versionrz"Bump the minor part of the versionrz"Bump the patch part of the versionrz'Bump the prerelease part of the versionrz"Bump the build part of the versionzVersion to raise�checkz,Checks if a string is a valid semver versionzVersion to check�nextverz=Determines the next version, taking prereleases into account.r0z1One of 'major', 'minor', 'patch', or 'prerelease')
�argparse�ArgumentParser�__package__�__doc__�add_argumentr�add_subparsers�
add_parser�set_defaultsr-r!r'r1)r�s�parser_compare�parser_bump�sb�p�parser_check�parser_nextvers        r �createparserrJVs_���
$�+�7�
K�
K�
K�F�
����I�{�[�/H�����	�����A��\�\�)�2H�\�I�I�N����[��1�1�1����
���A�A�A����
�1A��B�B�B��,�,�v�,=�,�>�>�K����(��+�+�+�	�	#�	#�/��	#�	G�	G�B�	�
�
�g�$H�
�I�I�
�
�
�g�$H�
�I�I�
�
�
�g�$H�
�I�I�
�
�
�l�)R�
�S�S�
�
�
�g�$H�
�I�I��;�;��	
���y�'9��:�:�:�:��<�<��D� ���L����9��-�-�-����i�.@��A�A�A��\�\��W�"���N����[��1�1�1����	�0B��C�C�C�����H� �����Mr"c��t|d��s'|j���t���|�|��S)z�
    Process the input from the CLI.

    :param args: The parsed arguments
    :param parser: the parser instance
    :return: result of the selected action
    r)�hasattrr�
print_help�
SystemExitrr&s r �processrO�sF���4�� � ������ � � ��l�l���9�9�T�?�?�r"�cliargsc��	t��}|�|���}||_t|��}|�t	|��dS#t
tf$r'}t	d|tj���Yd}~dSd}~wwxYw)z�
    Entry point for the application script.

    :param list cliargs: Arguments to parse or None (=use :class:`sys.argv`)
    :return: error code
    r&Nr�ERROR)�file�)	rJrrrO�printr%�	TypeError�sys�stderr)rPrr	�result�errs     r �mainr[�s��������� � �g� �.�.�������������&�M�M�M��q���	�"����
�g�s���,�,�,�,��q�q�q�q�q��������s�AA�B� B�B)N)r>r;rW�typingrrrrr�	__about__r�	Namespacerr!r'r-r1r<rJrO�intr[�r"r �<module>rasw��
�
�����
�
�
�
�'�'�'�'�'�'�'�'�'�'�������"�"�"�"�"�"��8�%��#�����8
:�H�&�
:�4�
:�
:�
:�
:�	,�h�(�	,�S�	,�	,�	,�	,�	0�h�(�	0�S�	0�	0�	0�	0�2�h�-�2�2�2�2�j
�(�$�
��
�
�
�
� ��(�4��9�%��������r"

Zerion Mini Shell 1.0