You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Igor Laberov <ig...@qlusters.com> on 2005/05/22 14:03:28 UTC
Issue in CLI package
Hi all,
I'm working with GnuParser from CLI and other commons libraries, you did
great work!
Just some issue.
Recently, I encountered with the following problem: if I pass arguments
like "-n m -m foo", the parser tries to interpret 'm' as an option,
though it was passed as argument value. When I've examinated the code,
noticed that in Parser.processArgs() "var" (i.e. value) is tried to be
found in Options list (and it is found, since Options.hasOption()
doesn't care about '-', but only about length).
It seems to me as a bug. Since change that I intended to do in Parser
will influence PosixParser (and may be other parsers too), it looks more
safe to change GnuParser (see attached diff) - override
Parser.processArgs() function, so argument value will not be interpreted
as an option.
What do you think?
Thanks,
Igor Laberov,
Qlusters Inc.