
    +                         d Z ddlmZ ddlmZ ddlmZ ddlmZ  G d dej                        Z	 	 	 	 	 	 	 dd	Z		 dd
Z
y)z>Templates for bundles of arguments surrounding a single field.    )absolute_import)division)unicode_literals)arg_parsersc                       e Zd ZdZy)HashDelimitedArgList#N)__name__
__module____qualname__DEFAULT_DELIM_CHAR     8lib/googlecloudsdk/command_lib/apigee/argument_groups.pyr   r      s    r   r   Nc                 ,   | j                         }|j                  |      }|j                  d|j                         j	                  dd      z   |	rt
        j                  nd|xs* |	rt        j                         nt        j                         |
rd|
z   ndd|d	|d
|xs  |j                         j	                  dd             |j                  d|j                         j	                  dd      z   d|xs t        j                         |
rd|
z   ndd|d|d
|xs  |j                         j	                  dd             |j                  |r|n"d|j                         j	                  dd      z   d|
rd|
z   nd|r|       yd|z         y)a  Adds arguments to `parser` for modifying a list field.

  A generic implementation of the style guidelines at
  go/gcloud-style#createupdate-command-flags.

  Args:
    parser: the ArgumentParser to which the arguments will be added.
    singular: singular form of the name of the field to be modified.
    plural: singular form of the name of the field to be modified.
    category_help: help text for the commands as a whole. Should explain what
      the field itself is.
    add_metavar: text to use as a placeholder in the add argument.
    remove_metavar: text to use as a placeholder in the remove argument.
    clear_arg: what to name the argument that clears the list.
    clear_help: help text for the argument that clears the list.
    collector_type: type for the add and remove arguments.
    dict_like: whether the list field has keys and values.
    dest: suffix for fields in the parsed argument object.
  )helpz--add- -appendadd_NzAdds a new z to the set of .)actiontypedestr   metavarz	--remove-remove_zRemoves an existing z from the set of --clear-
store_trueclear_zRemoves all %s.)r   r   r   )
add_mutually_exclusive_groupadd_argument_groupadd_argumentlowerreplacer   UpdateActionArgDictArgListupper)parsersingularpluralcategory_helpadd_metavarremove_metavar	clear_arg
clear_helpcollector_type	dict_liker   mutex_groupadd_remove_groups                r   AddEditableListArgumentr5      s   < 335+ 333G!))#s33)2[%% F ){{/B/B/D 6D=d08&A?X^^-55c3?   A HNN$,,S#662[002#9t;CVLB 0 8 8c B   D i*v||~/E/Ec3/O"O"8d?#:	  E *;V)C	  Er   c           	          | j                         } |j                  d|z   f|d|xs |j                  dd      z   d| |j                  d|z   d|xs |j                  dd      z   |d	       y
)a9  Adds arguments to `parser` for modifying or clearing a text field.

  A generic implementation of the style guidelines at
  go/gcloud-style#createupdate-command-flags.

  Args:
    parser: the ArgumentParser to which the arguments will be added.
    name: name of the field to be modified.
    set_help: help text for the argument that sets the field. Should explain
      what the field itself is.
    clear_help: help text for the argument that clears the field.
    dest: suffix for destiantion fields.
    **kwargs: additional parameters for the setter argument.
  z--set_r   _)r   r   r   r   r   )r   r   r   N)r    r"   r$   )r)   nameset_helpr0   r   kwargsr3   s          r   AddClearableArgumentr<   R   s    ( 335++
TkT3T\\#s34 		
 4t5t||C56	  r   )NNNNNFN)N)__doc__
__future__r   r   r   googlecloudsdk.callioper   r'   r   r5   r<   r   r   r   <module>r@      sQ    E &  ' /;..  )-+/&*'++/&+!%3Et #	r   