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 0FA454671 for ; Fri, 3 Jun 2011 00:07:29 +0000 (UTC) Received: (qmail 38843 invoked by uid 500); 3 Jun 2011 00:07:28 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 38787 invoked by uid 500); 3 Jun 2011 00:07:28 -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 38779 invoked by uid 99); 3 Jun 2011 00:07:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 00:07:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 00:07:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 534ADF1871 for ; Fri, 3 Jun 2011 00:06:47 +0000 (UTC) Date: Fri, 3 Jun 2011 00:06:47 +0000 (UTC) From: "Emmanuel Bourg (JIRA)" To: issues@commons.apache.org Message-ID: <931921417.64657.1307059607337.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <150973389.48575.1306500887509.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CLI-219) Allow to specify options with a single argument that will be split into multiple arguments 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-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043148#comment-13043148 ] Emmanuel Bourg commented on CLI-219: ------------------------------------ Thank you for the patch Gilles. Looking at your command line example I'm not convinced it's a good idea. If you were to allow several files arguments for an option I think the syntax you proposed would cause several problems: {code}-b "file1 file2 file3" arg1 arg2{code} - people will most likely forget to put the quotes - what if the file names also contain a space ? I would rather recommend the following syntax: {code}-b file1 -b file2 -b file3 arg1 arg2{code} or this one using a non space separator: {code}-b file1;file2;file3 arg1 arg2{code} For the latter you can either declare the option with a value separator, or split the value manually. > Allow to specify options with a single argument that will be split into multiple arguments > ------------------------------------------------------------------------------------------ > > Key: CLI-219 > URL: https://issues.apache.org/jira/browse/CLI-219 > Project: Commons CLI > Issue Type: New Feature > Components: CLI-1.x > Affects Versions: 1.2 > Reporter: Gilles > Labels: features > Fix For: 1.3 > > Attachments: svn_diff.txt > > > I've explained the issue in that thread: > http://www.mail-archive.com/user@commons.apache.org/msg06483.html > As hinted there, a solution might be to allow that the (single) argument of an "Option" (cf. "hasArg()") be split according to a user-defined regexp pattern. If given a split pattern, the code would convert a single-arg "Option" into a multiple-args one (where the arguments are the result of splitting the single-arg string with the pattern). -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira