commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CLI-229) Missing place holder in required argument
Date Sun, 27 Jan 2013 20:53:12 GMT

     [ https://issues.apache.org/jira/browse/CLI-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Thomas Neidhart resolved CLI-229.
---------------------------------

    Resolution: Duplicate

This has been verified as a duplicate of CLI-186, and will be fixed in 1.3.
                
> Missing place holder in required argument
> -----------------------------------------
>
>                 Key: CLI-229
>                 URL: https://issues.apache.org/jira/browse/CLI-229
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.2
>         Environment: Windows 7 x64, Java 1.7.9
>            Reporter: Palmer Eldritch
>            Priority: Minor
>             Fix For: 1.3
>
>
> The code below :
> {code}
> @SuppressWarnings("static-access")
> public class CliArgBug {
> 	private static final Options OPTIONS = new Options();
> 	static {
> 		// FIXME : bug ? usage prints --seq1 --seq2 <arg> - notice <arg>
> 		// missing in seq1 - corrected by adding .withArgName("file1")
> 		OPTIONS.addOption(OptionBuilder
> 				.withLongOpt("seq1")
> 				.withDescription(
> 						"REQUIRED : the file containing sequence 1")
> 				.hasArg().isRequired().create());
> 		OPTIONS.addOption(OptionBuilder
> 				.withLongOpt("seq2")
> 				.withDescription(
> 						"REQUIRED : the file containing sequence 2")
> 				.hasArg().isRequired().create());
> 	}
> 	public static void main(String[] args) {
> 		HelpFormatter formatter = new HelpFormatter();
> 		formatter.printHelp("Notice <arg> is missing in seq1", OPTIONS, true);
> 	}
> }
> {code}
> Produces :
> {code}
> usage: Notice <arg> is missing in seq1 --seq1 --seq2 <arg>
>     --seq1         REQUIRED : the file containing sequence 
>     --seq2 <arg>   REQUIRED : the file containing sequence 2
> {code}
> Also I was not able to find any info on where this placeholder <arg> is defined
- please add this to the javadoc
> Thanks

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message