extending optionparser to accept multiple comma delimited input for one arg

Terry Reedy tjreedy at udel.edu
Fri Nov 27 22:42:42 CET 2009


cmptrwhz wrote:
> On Nov 27, 2:33 am, Peter Otten <__pete... at web.de> wrote:
>> If you had problems understanding the documentation perhaps you can suggest
>> an improvement.
>>
>> Peter
> First I would like to thank you very much for the quick and concise
> answer this is very clear to me as to what I need to do now. Thank you
> so much.
> 
> The one thing that threw me off and confused me is that I went back in
> the docs to see what actions are available to see if extend was an
> allowable action.  in section 14.3.2.4 Other actions, I did not see
> that extend was a valid action so I looked thru section 14.3.3.3
> Defining options and this section did not show extend as a valid
> action.  I believe that if there was a complete disclosure of actions
> available then I would have seen the error in my thinking.  Everything
> else made sense up to the point of where the subclass was described in
> the docs as above but if the next couple lines you gave me was added
> to this section (14.3.5.2 Adding new actions) it was have completed
> the confirmation I needed that it was ok to type in extend as an
> action.  Maybe I am still not understanding this concept fully still
> but I hope I am making sense with my point.
> 
> So my suggestion would be to include this tidbit of extra as you have
> described to me in the section 14.3.5.2 and all would have been as
> clear as sunshine.  :) thank you again for your time and listening to
> my thoughts.
> 
> parser = OptionParser(option_class=MyOption)
> parser.add_option("-i", "--input", action="extend")
> 
> options, args = parser.parse_args()
> print options

Please go to bugs.python.org, register if you have not, and add a type: 
feature request, component: documentation issue giving the exact 
sentence you suggest adding (keeping in mind the existing doc style) and 
the exact proposed location. Then explain, briefly, why.




More information about the Python-list mailing list