o .&a @sbddlZddlmZddlmZeeZdZdeZ ddZ dd Z d d Z Gd d d eZ dS)N)model)BaseCLIArgumentaY

Number of instances to launch. If a single number is provided, it is assumed to be the minimum to launch (defaults to %d). If a range is provided in the form min:max then the first number is interpreted as the minimum number of instances to launch and the second is interpreted as the maximum number of instances to launch.

cCs|dt|dtdS)Nz)building-argument-table.ec2.run-instancesz'before-parameter-build.ec2.RunInstances)register ec2_add_countset_default_count) event_handlerr D/usr/lib/python3/dist-packages/awscli/customizations/ec2/addcount.pyregister_count_events s r cKstd|d<|d=|d=dS)Ncountz min-countz max-count) CountArgument)argument_tablekwargsr r r r's  rcKs|dt|dtdS)NMaxCountMinCount) setdefaultDEFAULT)paramsrr r r r-s rc@sbeZdZddZeddZeddZeddZejd dZed d Z d d Z ddZ dS)r cCs"tdddi|_||_d|_dS)Nr typestringF)rShapeargument_model_name _required)selfnamer r r __init__4s zCountArgument.__init__cCs d|jS)Nz--)rrr r r cli_name9 zCountArgument.cli_namecCsdS)Nrr rr r r cli_type_name=zCountArgument.cli_type_namecCs|jSNrrr r r requiredAszCountArgument.requiredcCs ||_dSr#r$)rvaluer r r r%Er cCstSr#)HELPrr r r documentationIr"zCountArgument.documentationcCs|j|j|jdddS)NzNumber of instances to launch)metavarhelp) add_argumentrpy_name)rparserr r r add_to_parserMs  zCountArgument.add_to_parsercCs`|durdSz d|vr|d\}}n||}}t||d<t||d<WdSd}t|)N:rrzs