File: //var/opt/nydus/ops/shortuuid/__pycache__/cli.cpython-39.pyc
a
�,�h� � @ s� d dl Z d dlZd dlmZ d dlmZ ddlmZ ddlmZ ddlmZ e j d�d d
�Z
e j d�dd�Zedd
�dd�Ze
dkr�eejdd� � dS )� N)�Any)�UUID� )�decode)�encode)�uuid��argsc C s t t| j�� d S )N)�printr r r � r �>/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/shortuuid/cli.py�
encode_cli s r
c C s t tt| j| jd��� d S )N)�legacy)r
�strr � shortuuidr r r r r �
decode_cli s r )r �returnc G s� t jddd�}|jdd�}|jddtjd�}|jd td
d� |jt d� |jd
dt
jd�}|jdtdd� |jddd� |jtd� |j
| � }t|d�r�|�|� n
tt� � d S )Nz&Generate, encode and decode shortuuidsz.top-level command generates a random shortuuid)�description�epilogzsub-command help)�helpr zEncode a UUID into a short UUID)r r r zUUID to be encoded)�typer )�funcr zDecode a short UUID into a UUIDr zShort UUID to be decodedz--legacy�
store_true)�actionr )�argparse�ArgumentParser�add_subparsers�
add_parserr �__doc__�add_argumentr �set_defaultsr
r r r �
parse_args�hasattrr r
r )r �parserZ
subparsersZ
encode_parserZ
decode_parserZpassed_argsr r r �cli s( ���
r$ �__main__)r �sys�typingr r r �mainr r � Namespacer
r r$ �__name__�argvr r r r �<module> s