Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 10A5CE741 for ; Sun, 27 Jan 2013 20:53:13 +0000 (UTC) Received: (qmail 15912 invoked by uid 500); 27 Jan 2013 20:53:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 15849 invoked by uid 500); 27 Jan 2013 20:53:13 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 15838 invoked by uid 99); 27 Jan 2013 20:53:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Jan 2013 20:53:13 +0000 Date: Sun, 27 Jan 2013 20:53:12 +0000 (UTC) From: "Thomas Neidhart (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CLI-229) Missing place holder in required argument MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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 - notice > // 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 is missing in seq1", OPTIONS, true); > } > } > {code} > Produces : > {code} > usage: Notice is missing in seq1 --seq1 --seq2 > --seq1 REQUIRED : the file containing sequence > --seq2 REQUIRED : the file containing sequence 2 > {code} > Also I was not able to find any info on where this placeholder 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