o ca @stdZddlmZddlZddlZddlZddZGdddeZdd Z d d Z d d Z ddZ ddZ ddZdS)z Wheel command-line utility. )print_functionNcCs,zddl}WdStytd|w)Nrz/'{0}' needs pkg_resources (part of setuptools).) pkg_resources ImportError RuntimeErrorformat)namerr4/usr/lib/python3/dist-packages/wheel/cli/__init__.pyrequire_pkgresources s  r c@s eZdZdS) WheelErrorN)__name__ __module__ __qualname__rrrr r sr cCsddlm}||j|jdS)N)unpack)r wheelfiledest)argsrrrr unpack_fs rcC"ddlm}||j|j|jdS)Nr)pack)r directorydest_dir build_number)rrrrr pack_f rcCr)Nr)convert)rfilesrverbose)rrrrr convert_f!rrcCsddlm}td|dS)N) __version__zwheel %s)r!print)rr!rrr version_f&s r$cs*tjdd}|jddd}|jddddd |jd d d|jtd |jd dd}|jddd|jddtjj dd|jddd|jt d |jddd}|jdddd|jddtjj dd|jdddd |jt d |jd!d"d}|jt d |jd#d$d}|jfd%d&d S)'Ncommands)helprz Unpack wheelz--destz-dzDestination directory.)r&defaultrz Wheel file)funcrz Repack wheelrz$Root directory of the unpacked wheelz --dest-dirz2Directory to store the wheel (default %(default)s))r(r&z--build-numberz"Build tag to use in the wheel namerzConvert egg or wininst to wheelr*zFiles to convert)nargsr&z/Directory to store wheels (default %(default)s)z --verbosez-v store_true)actionversionzPrint version and exitr&zShow this helpcsS)N) print_help)rprr Gszparser..) argparseArgumentParseradd_subparsers add_parser add_argument set_defaultsrospathcurdirrrr$)s unpack_parser repack_parserconvert_parserversion_parser help_parserrr0r parser+s6      rBc Csjt}|}t|ds|dSz||WdSty4}zt|tjdWYd}~dSd}~ww)Nr)r)filer) rB parse_argshasattrr/r)r r#sysstderr)r1rerrr mainLs  rI)__doc__ __future__rr3r9rFr Exceptionr rrrr$rBrIrrrr s  !