File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -726,6 +726,9 @@ how the command-line arguments should be handled. The supplied actions are:
726726
727727  .. versionadded :: 3.8 
728728
729+ Only actions that consume command-line arguments (e.g. ``'store' ``,
730+ ``'append' `` or ``'extend' ``) can be used with positional arguments.
731+ 
729732You may also specify an arbitrary action by passing an Action subclass or
730733other object that implements the same interface. The ``BooleanOptionalAction ``
731734is available in ``argparse `` and adds support for boolean actions such as
@@ -853,6 +856,8 @@ See also :ref:`specifying-ambiguous-arguments`. The supported values are:
853856If the ``nargs `` keyword argument is not provided, the number of arguments consumed
854857is determined by the action _.  Generally this means a single command-line argument
855858will be consumed and a single item (not a list) will be produced.
859+ Actions that do not consume command-line arguments (e.g.
860+ ``'store_const' ``) set ``nargs=0 ``.
856861
857862
858863.. _const :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments