commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (CLI-147) Create page explaining which parser to use when
Date Sun, 01 Jun 2008 19:49:45 GMT

    [ https://issues.apache.org/jira/browse/CLI-147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601491#action_12601491
] 

ebourg edited comment on CLI-147 at 6/1/08 12:47 PM:
-------------------------------------------------------------

Regarding the GnuParser, it processes every token as a potential option. That means it will
split a token if it recognizes an option even if it's actually the mandatory argument of the
previous option.

For example with the option 1 and N both having a mandatory argument, the following command
line:

{code}-N -123{code}

will be interpreted as the option N with no argument, and the option 1 with 23 as argument.
But the right interpretation is N=-123. The token -123 has been processed as a potential option
first before being considered as the argument of the previous option.

      was (Author: ebourg):
    Regarding the GnuParser, it processes every token as a potential option. That means it
will split a token if it recognizes an option even if it's actually the mandatory argument
of the previous option.

For example with the option 1 and N both having a mandatory argument, the following command
line:

{code}-N -123{code}

will be interpreted as the option N with no argument, and the option 1 with 23 as argument.
But the right interpretation is N=-123. The token -123 has be processed as a potential option
first before being considered as the argument of the previous option.
  
> Create page explaining which parser to use when
> -----------------------------------------------
>
>                 Key: CLI-147
>                 URL: https://issues.apache.org/jira/browse/CLI-147
>             Project: Commons CLI
>          Issue Type: Task
>          Components: Documentation
>    Affects Versions: 1.1
>            Reporter: Henri Yandell
>            Assignee: Henri Yandell
>             Fix For: 1.2
>
>
> Basically a short summary of what each parser does.
> Also put each relevant bit in the javadoc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message