Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 97301 invoked from network); 15 May 2007 13:02:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 May 2007 13:02:39 -0000 Received: (qmail 11096 invoked by uid 500); 15 May 2007 13:02:45 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 10673 invoked by uid 500); 15 May 2007 13:02:43 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 10657 invoked by uid 99); 15 May 2007 13:02:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 May 2007 06:02:43 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 May 2007 06:02:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5232571406A for ; Tue, 15 May 2007 06:02:16 -0700 (PDT) Message-ID: <16151303.1179234136334.JavaMail.jira@brutus> Date: Tue, 15 May 2007 06:02:16 -0700 (PDT) From: "Brian Egge (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Updated: (CLI-51) [cli] Parameter value "-something" misinterpreted as a parameter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CLI-51?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brian Egge updated CLI-51: -------------------------- Attachment: CL51.patch Updated patch. Removed incorrect license header; removed formatting changed; reverted access level change. > [cli] Parameter value "-something" misinterpreted as a parameter > ---------------------------------------------------------------- > > Key: CLI-51 > URL: https://issues.apache.org/jira/browse/CLI-51 > Project: Commons CLI > Issue Type: Bug > Components: CLI-1.x > Affects Versions: Nightly Builds > Environment: Operating System: Windows NT > Platform: PC > Reporter: Nigel King > Priority: Critical > Fix For: 1.1 > > Attachments: CL51.patch, CL51.patch > > > If a parameter value is passed that contains a hyphen as the (delimited) first > character, CLI parses this a parameter. For example using the call > java myclass -t "-something" > Results in the parser creating the invalid parameter -o (noting that it is > skipping the 's') > My code is using the Posix parser as follows > Options options = buildCommandLineOptions(); > CommandLineParser parser = new PosixParser(); > CommandLine commandLine = null; > try { > > commandLine = parser.parse(options, args); > } > catch (ParseException e) { > > System.out.println("Invalid parameters. " + e.getMessage() + NEW_LINE); > System.exit(EXIT_CODE_ERROR); > } > This has been tested against the nightly build dated 20050503. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org