You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Nathan Niesen (JIRA)" <ji...@apache.org> on 2008/01/16 18:06:34 UTC

[jira] Created: (CLI-149) MissingOptionException.getMessage() changed from CLI 1.0 > 1.1

MissingOptionException.getMessage() changed from CLI 1.0 > 1.1
--------------------------------------------------------------

                 Key: CLI-149
                 URL: https://issues.apache.org/jira/browse/CLI-149
             Project: Commons CLI
          Issue Type: Bug
          Components: CLI-1.x
    Affects Versions: 1.1
            Reporter: Nathan Niesen


The MissingOptionException.getMessage() string changed from CLI 1.0 > 1.1. 

CLI 1.0 was poorly formatted but readable:
Missing required options: -format-source-properties

CLI 1.1 is almost unreadable:
Missing required options: formatsourceproperties

In CLI 1.0 Options.addOption(Option) prefixed the stored options with a "-" and in CLI 1.1 it doesn't.

I would suggest changing Parser.checkRequiredOptions() to add the options to the error message with a prefix of " -":

OLD: 
            // loop through the required options
            while (iter.hasNext())
            {
                buff.append(iter.next());
            }

NEW: 
            // loop through the required options
            while (iter.hasNext())
            {
                buff.append(" -" + iter.next());
            }

Resulting in:
Missing required options: -format -source -properties


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


[jira] Issue Comment Edited: (CLI-149) MissingOptionException.getMessage() changed from CLI 1.0 > 1.1

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLI-149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595130#action_12595130 ] 

bayard edited comment on CLI-149 at 5/7/08 11:50 PM:
------------------------------------------------------------

Agreed on the whitespace. I don't see why it shouldn't be:

Missing required options: format, source, properties

      was (Author: bayard):
    Agreed on the whitespace. I don't see why it should be:

Missing required options: format, source, properties
  
> MissingOptionException.getMessage() changed from CLI 1.0 > 1.1
> --------------------------------------------------------------
>
>                 Key: CLI-149
>                 URL: https://issues.apache.org/jira/browse/CLI-149
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.1
>            Reporter: Nathan Niesen
>             Fix For: 1.2
>
>
> The MissingOptionException.getMessage() string changed from CLI 1.0 > 1.1. 
> CLI 1.0 was poorly formatted but readable:
> Missing required options: -format-source-properties
> CLI 1.1 is almost unreadable:
> Missing required options: formatsourceproperties
> In CLI 1.0 Options.addOption(Option) prefixed the stored options with a "-" and in CLI 1.1 it doesn't.
> I would suggest changing Parser.checkRequiredOptions() to add the options to the error message with a prefix of " -":
> OLD: 
>             // loop through the required options
>             while (iter.hasNext())
>             {
>                 buff.append(iter.next());
>             }
> NEW: 
>             // loop through the required options
>             while (iter.hasNext())
>             {
>                 buff.append(" -" + iter.next());
>             }
> Resulting in:
> Missing required options: -format -source -properties

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


[jira] Updated: (CLI-149) MissingOptionException.getMessage() changed from CLI 1.0 > 1.1

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLI-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated CLI-149:
------------------------------

    Fix Version/s: 1.2

> MissingOptionException.getMessage() changed from CLI 1.0 > 1.1
> --------------------------------------------------------------
>
>                 Key: CLI-149
>                 URL: https://issues.apache.org/jira/browse/CLI-149
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.1
>            Reporter: Nathan Niesen
>             Fix For: 1.2
>
>
> The MissingOptionException.getMessage() string changed from CLI 1.0 > 1.1. 
> CLI 1.0 was poorly formatted but readable:
> Missing required options: -format-source-properties
> CLI 1.1 is almost unreadable:
> Missing required options: formatsourceproperties
> In CLI 1.0 Options.addOption(Option) prefixed the stored options with a "-" and in CLI 1.1 it doesn't.
> I would suggest changing Parser.checkRequiredOptions() to add the options to the error message with a prefix of " -":
> OLD: 
>             // loop through the required options
>             while (iter.hasNext())
>             {
>                 buff.append(iter.next());
>             }
> NEW: 
>             // loop through the required options
>             while (iter.hasNext())
>             {
>                 buff.append(" -" + iter.next());
>             }
> Resulting in:
> Missing required options: -format -source -properties

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


[jira] Commented: (CLI-149) MissingOptionException.getMessage() changed from CLI 1.0 > 1.1

Posted by "Alexandru Luchian (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLI-149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583041#action_12583041 ] 

Alexandru Luchian commented on CLI-149:
---------------------------------------

Also, there are no spaces between option names.

It should be something like:

NEW:
// loop through the required options
while (iter.hasNext())
{ buff.append(" -" + iter.next() + " "); }

OR

NEW:
// loop through the required options
while (iter.hasNext())
{ buff.append(iter.next() + " "); }


> MissingOptionException.getMessage() changed from CLI 1.0 > 1.1
> --------------------------------------------------------------
>
>                 Key: CLI-149
>                 URL: https://issues.apache.org/jira/browse/CLI-149
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.1
>            Reporter: Nathan Niesen
>             Fix For: 1.2
>
>
> The MissingOptionException.getMessage() string changed from CLI 1.0 > 1.1. 
> CLI 1.0 was poorly formatted but readable:
> Missing required options: -format-source-properties
> CLI 1.1 is almost unreadable:
> Missing required options: formatsourceproperties
> In CLI 1.0 Options.addOption(Option) prefixed the stored options with a "-" and in CLI 1.1 it doesn't.
> I would suggest changing Parser.checkRequiredOptions() to add the options to the error message with a prefix of " -":
> OLD: 
>             // loop through the required options
>             while (iter.hasNext())
>             {
>                 buff.append(iter.next());
>             }
> NEW: 
>             // loop through the required options
>             while (iter.hasNext())
>             {
>                 buff.append(" -" + iter.next());
>             }
> Resulting in:
> Missing required options: -format -source -properties

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


[jira] Commented: (CLI-149) MissingOptionException.getMessage() changed from CLI 1.0 > 1.1

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLI-149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595130#action_12595130 ] 

Henri Yandell commented on CLI-149:
-----------------------------------

Agreed on the whitespace. I don't see why it should be:

Missing required options: format, source, properties

> MissingOptionException.getMessage() changed from CLI 1.0 > 1.1
> --------------------------------------------------------------
>
>                 Key: CLI-149
>                 URL: https://issues.apache.org/jira/browse/CLI-149
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.1
>            Reporter: Nathan Niesen
>             Fix For: 1.2
>
>
> The MissingOptionException.getMessage() string changed from CLI 1.0 > 1.1. 
> CLI 1.0 was poorly formatted but readable:
> Missing required options: -format-source-properties
> CLI 1.1 is almost unreadable:
> Missing required options: formatsourceproperties
> In CLI 1.0 Options.addOption(Option) prefixed the stored options with a "-" and in CLI 1.1 it doesn't.
> I would suggest changing Parser.checkRequiredOptions() to add the options to the error message with a prefix of " -":
> OLD: 
>             // loop through the required options
>             while (iter.hasNext())
>             {
>                 buff.append(iter.next());
>             }
> NEW: 
>             // loop through the required options
>             while (iter.hasNext())
>             {
>                 buff.append(" -" + iter.next());
>             }
> Resulting in:
> Missing required options: -format -source -properties

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


[jira] Closed: (CLI-149) MissingOptionException.getMessage() changed from CLI 1.0 > 1.1

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLI-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed CLI-149.
-----------------------------

    Resolution: Fixed

svn ci -m "Adding comma delimited whitespace to the exception message that lists missing required options as requested in CLI-149. I didn't add the requested -, as it could be -- or some other prefix. Unit tests also added. "

Sending        src/java/org/apache/commons/cli/Parser.java
Sending        src/test/org/apache/commons/cli/OptionsTest.java
Sending        src/test/org/apache/commons/cli/ParseRequiredTest.java
Transmitting file data ...
Committed revision 654431.

> MissingOptionException.getMessage() changed from CLI 1.0 > 1.1
> --------------------------------------------------------------
>
>                 Key: CLI-149
>                 URL: https://issues.apache.org/jira/browse/CLI-149
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.1
>            Reporter: Nathan Niesen
>             Fix For: 1.2
>
>
> The MissingOptionException.getMessage() string changed from CLI 1.0 > 1.1. 
> CLI 1.0 was poorly formatted but readable:
> Missing required options: -format-source-properties
> CLI 1.1 is almost unreadable:
> Missing required options: formatsourceproperties
> In CLI 1.0 Options.addOption(Option) prefixed the stored options with a "-" and in CLI 1.1 it doesn't.
> I would suggest changing Parser.checkRequiredOptions() to add the options to the error message with a prefix of " -":
> OLD: 
>             // loop through the required options
>             while (iter.hasNext())
>             {
>                 buff.append(iter.next());
>             }
> NEW: 
>             // loop through the required options
>             while (iter.hasNext())
>             {
>                 buff.append(" -" + iter.next());
>             }
> Resulting in:
> Missing required options: -format -source -properties

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