@@ -121,7 +121,7 @@ def __proxy_to_real_parser(value):
121121 if isinstance (value , ProxyArgumentParser ):
122122 return __parsers [value ]
123123 elif isinstance (value , (list , tuple )):
124- return [__proxy_to_real_parser (_ ) for _ in value ]
124+ return [__proxy_to_real_parser (v ) for v in value ]
125125 return value
126126 # now iterate over the registered calls
127127 from .argreparse import parser_calls
@@ -145,13 +145,13 @@ def __proxy_to_real_parser(value):
145145 note = gt ("this overrides other arguments" ))
146146 c .add_argument ("-w" , "--write-config" , metavar = "INI" , help = gt ("write args to a config file" ))
147147 if noarg and noargs_action == "config" :
148- tokens [1 :] = [opt , "config.ini" ]
148+ tokens [1 :] = [opt . option_strings [ - 1 ] , "config.ini" ]
149149 # demonstration feature, for executing an example amongst these defined in __examples__, useful for observing what
150150 # the tool does
151151 if add ['demo' ]:
152152 opt = i .add_argument ("--demo" , action = "demo" , prefix = "play" , help = gt ("demonstrate a random example" ))
153153 if noarg and noargs_action == "demo" :
154- tokens [1 :] = [opt ]
154+ tokens [1 :] = [opt . option_strings [ - 1 ] ]
155155 # help feature, for displaying classical or extended help about the tool
156156 if add ['help' ]:
157157 if glob .get ('__details__' ):
@@ -176,25 +176,25 @@ def __proxy_to_real_parser(value):
176176 j .add_argument ("--port" , default = 12345 , type = port_number , prefix = "remote" ,
177177 help = gt ("remote interacting port" ))
178178 if noarg and noargs_action == "interact" :
179- tokens [1 :] = [opt ]
179+ tokens [1 :] = [opt . option_strings [ - 1 ] ]
180180 set_interact_items (glob )
181181 # notification feature, for displaying notifications during the execution
182182 if add ['notify' ]:
183183 opt = i .add_argument ("-n" , "--notify" , action = "store_true" , suffix = "mode" , help = gt ("notify mode" ))
184184 if noarg and noargs_action == "notify" :
185- tokens [1 :] = [opt ]
185+ tokens [1 :] = [opt . option_strings [ - 1 ] ]
186186 set_notify_items (glob )
187187 # progress mode feature, for displaying a progress bar during the execution
188188 if add ['progress' ]:
189189 opt = i .add_argument ("-p" , "--progress" , action = "store_true" , suffix = "mode" , help = gt ("progress mode" ))
190190 if noarg and noargs_action == "progress" :
191- tokens [1 :] = [opt ]
191+ tokens [1 :] = [opt . option_strings [ - 1 ] ]
192192 set_progress_items (glob )
193193 # stepping mode feature, for stepping within the tool during its execution, especially useful for debugging
194194 if add ['step' ]:
195195 opt = i .add_argument ("--step" , action = "store_true" , last = True , suffix = "mode" , help = gt ("stepping mode" ))
196196 if noarg and noargs_action == "step" :
197- tokens [1 :] = [opt ]
197+ tokens [1 :] = [opt . option_strings [ - 1 ] ]
198198 set_step_items (glob )
199199 # timing mode feature, for measuring time along the execution of the tool
200200 if add ['time' ]:
@@ -204,15 +204,15 @@ def __proxy_to_real_parser(value):
204204 b .add_argument ("--timings" , action = 'store_true' , last = True , suffix = "mode" ,
205205 help = gt ("display time stats during execution" ))
206206 if noarg and noargs_action == "time" :
207- tokens [1 :] = [opt ]
207+ tokens [1 :] = [opt . option_strings [ - 1 ] ]
208208 # version feature, for displaying the version from __version__
209209 if add ['version' ]:
210210 version = glob ['__version__' ] if '__version__' in glob else None
211211 if version is not None :
212212 opt = i .add_argument ("--version" , action = 'version' , prefix = "show" , version = version ,
213213 help = gt ("show program's version number and exit" ))
214214 if noarg and noargs_action == "version" :
215- tokens [1 :] = [opt ]
215+ tokens [1 :] = [opt . option_strings [ - 1 ] ]
216216 # verbosity feature, for displaying debugging messages, with the possibility to handle multi-level verbosity
217217 if multi_level_debug :
218218 i .add_argument ("-v" , dest = "verbose" , default = 0 , action = "count" , suffix = "mode" , cancel = True , last = True ,
@@ -223,7 +223,7 @@ def __proxy_to_real_parser(value):
223223 if add ['wizard' ]:
224224 opt = i .add_argument ("-w" , "--wizard" , action = "wizard" , prefix = "start" , help = gt ("start a wizard" ))
225225 if noarg and noargs_action == "wizard" :
226- tokens [1 :] = [opt ]
226+ tokens [1 :] = [opt . option_strings [ - 1 ] ]
227227 # reporting feature, for making a reporting with the results of the tool at the end of its execution
228228 if report_func is not None :
229229 if not isfunction (report_func ):
0 commit comments