Argparser and complex types
I'd like to provide my user the possibility to add multiple complex
objects, as example: a Library object would be: - library_name -
library_number - ...
To do so what I did is to set a parameter --library with an append action
and add a type to the parameter so it reads it the right format, what lead
to the following command line: --library
"library_name=test;library_number=5", the library type function will test
and do the work, but this is not realy a pretty way to do it, there is any
other way to do what I want ?
I wanted to use the nargs like this: --library test 5 this look better to
me however the type function I want to associate cannot be a complex one
as it is runed on each values of the returned array!
any idea ? Jerome
No comments:
Post a Comment