U af@sddlZddlZddlmZddlmZddlmZddlmZddlmZej dd d Z ej dd d Z edd ddZ e dkre ejdddS)N)Any)UUID)decode)encode)uuidargscCstt|jdS)N)printrrrr >/opt/nydus/tmp/pip-target-53d1vnqk/lib/python/shortuuid/cli.py encode_cli sr cCsttt|j|jddS)N)legacy)r strr shortuuidrrr r r decode_clisr)r returncGstjddd}|jdd}|jddtjd}|jd td d |jt d |jd dt jd}|jdt dd |jddd|jt d |j |}t|dr||n ttdS)Nz&Generate, encode and decode shortuuidsz.top-level command generates a random shortuuid) descriptionepilogzsub-command help)helprzEncode a UUID into a short UUID)rrrzUUID to be encoded)typer)funcrzDecode a short UUID into a UUIDrzShort UUID to be decodedz--legacy store_true)actionr)argparseArgumentParseradd_subparsers add_parserr__doc__ add_argumentr set_defaultsr rrr parse_argshasattrrr r)r parserZ subparsersZ encode_parserZ decode_parserZ passed_argsr r r clis0      r$__main__)rsystypingrrrmainrr Namespacer rr$__name__argvr r r r s