Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 84340 invoked from network); 2 Apr 2008 21:28:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Apr 2008 21:28:36 -0000 Received: (qmail 155 invoked by uid 500); 2 Apr 2008 21:28:31 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 99996 invoked by uid 500); 2 Apr 2008 21:28:31 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Delivered-To: moderator for user@commons.apache.org Received: (qmail 2608 invoked by uid 99); 2 Apr 2008 15:28:37 -0000 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Reply-To: From: "Daniel Tripp" To: Subject: [cli] method to convert a string (which is a whole command line) into an array (of arguments) Date: Wed, 2 Apr 2008 10:29:26 -0500 Organization: MDI Solutions Limited Message-ID: <002601c894d6$57adf6b0$bb00a8c0@newdan> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0027_01C894AC.6ED7EEB0" X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Thread-Index: AciU1lW+P/VSKDlMTVyns5qp+MrHIw== X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host54.canaca.com X-AntiAbuse: Original Domain - commons.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mdisolutions.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked by ClamAV on apache.org ------=_NextPart_000_0027_01C894AC.6ED7EEB0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello. I've been looking for a method to parse a command-line string into an string-array (for use with commons CLI, Runtime.exec(), etc.) I haven't been able to find one in commons CLI. So my questions are: a) Is there a method in the commons (CLI or elsewhere) that does this, that I have missed? b) If not, might such a method be a welcome addition to the commons? (because I have such a method right here, lifted from Eclipse.) This need arises from a part of my application where the user can enter a command line into a GUI text field, which needs to be able to handle arguments with spaces via quotes, escaped quotes, etc. I ended up using some code lifted from Eclipse, which corresponds to what happens to the strings entered in the Run dialog > Java application > Arguments tab before a process is launched (since, obviously, the user-entered command-line string needs to be converted into a string-array somehow.) ------=_NextPart_000_0027_01C894AC.6ED7EEB0--