
                         (    S r SSKrSSKJr  S rS rg)zThis package defines a few functions to add and parse platforms arguments.

These arguments are used to select the image to pull when given a Docker
manifest list.
    N)docker_image_listc                     U R                  SSS9  U R                  SSS9  U R                  SSSS	9  U R                  S
SS9  U R                  SSS9  U R                  SSSS	9  g)zcAdds command-line arguments for platform fields.

Args:
  parser: argparser.ArgumentParser object.
z--oszBFor multi-platform manifest lists, specifies the operating system.)helpz--os-versionzJFor multi-platform manifest lists, specifies the operating system version.z--os-features*zGFor multi-platform manifest lists, specifies operating system features.)nargsr   z--architecturezBFor multi-platform manifest lists, specifies the CPU architecture.z	--variantz=For multi-platform manifest lists, specifies the CPU variant.z
--featuresz:For multi-platform manifest lists, specifies CPU features.N)add_argument)parsers    9lib/third_party/containerregistry/tools/platform_args_.pyAddArgumentsr      s     	  
 	  
 	   	  
 	J  L 	G  I    c                 $  ^ 0 mU4S jnU" SU R                   5        U" SU R                  5        U" SU R                  5        U" SU R                  5        U" SU R                  5        U" SU R
                  5        [        R                  " T5      $ )zEPopulates a docker_image_list.Platform object from the provided args.c                    > Ub  UTU '   g g )N )kvps     r
   	_SetFieldFromArgs.<locals>._SetFieldB   s    }ad r   osz
os.versionzos.featuresarchitecturevariantfeatures)r   
os_versionos_featuresr   r   r   r   Platform)argsr   r   s     @r
   FromArgsr   >   sx    ! D$''L$//*M4++,ND--.It||$J&		#	#A	&&r   )__doc__argparsecontainerregistry.client.v2_2r   r   r   r   r   r
   <module>r!      s     ;"IJ'r   