argparse missing optparse capabilities?

rurpy at yahoo.com rurpy at yahoo.com
Thu Jan 5 03:26:56 EST 2012


On Jan 5, 1:05 am, "ru... at yahoo.com" <ru... at yahoo.com> wrote:
>   class AppendWithPos (argparse.Action):
>     def __call__ (self, parser, namespace, values,
> option_string=None):
>         if getattr (namespace, self.dest, None) is None:
>             setattr (namespace, self.dest, [])
>         getattr (namespace, self.dest).extend ((values, len (parser.largs)))

I realized right after posting that the above line should
be I think,
  getattr (namespace, self.dest).extend ((values, len
(namespace.src)))

but that still doesn't help with the "unrecognised arguments"
problem.



More information about the Python-list mailing list