From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29170 invoked by alias); 26 Feb 2008 04:44:42 -0000 Received: (qmail 29141 invoked by uid 9519); 26 Feb 2008 04:44:39 -0000 Date: Tue, 26 Feb 2008 04:44:00 -0000 Message-ID: <20080226044439.29126.qmail@sourceware.org> From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Fix bz #5793, parameters to run/start not accepting parameters with "-" at beginning. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: cc4b69ddad67f0d3efcb1574f32f37d0ad3e92e6 X-Git-Newrev: 7867d597f2f3c2557d30f38518951d41cddfc247 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q1/txt/msg00245.txt.bz2 The branch, master has been updated via 7867d597f2f3c2557d30f38518951d41cddfc247 (commit) from cc4b69ddad67f0d3efcb1574f32f37d0ad3e92e6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 7867d597f2f3c2557d30f38518951d41cddfc247 Author: Rick Moseley Date: Mon Feb 25 22:42:27 2008 -0600 Fix bz #5793, parameters to run/start not accepting parameters with "-" at beginning. * Input.java (getFullCommand): New. * ParmeterizedCommand.java: If a start/run command is issued, do not parse the commands, pass straight to the command. * TestRunCommand.java: Test for parameters with "-" at the beginning. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/hpd/ChangeLog | 8 ++++++++ frysk-core/frysk/hpd/Input.java | 9 +++++++++ frysk-core/frysk/hpd/ParameterizedCommand.java | 4 ++++ frysk-core/frysk/hpd/TestRunCommand.java | 10 +++++++--- 4 files changed, 28 insertions(+), 3 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index fc9b4d7..b3b3b5d 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,11 @@ +2008-02-25 Rick Moseley + + * Input.java (getFullCommand): New. + * ParmeterizedCommand.java: If a start/run command is issued, do not + parse the commands, pass straight to the command. + * TestRunCommand.java: Test for parameters with "-" at the + beginning. + 2008-02-25 Andrew Cagney * LoadCommand.java: Use LinuxExeFactory. diff --git a/frysk-core/frysk/hpd/Input.java b/frysk-core/frysk/hpd/Input.java index c47f68b..0c12e75 100644 --- a/frysk-core/frysk/hpd/Input.java +++ b/frysk-core/frysk/hpd/Input.java @@ -294,4 +294,13 @@ class Input { return new Token(fullCommand.substring(token.start, token.end), token.start, cursor); } + + /** + * getFullCommand passes a full copy of the command to the caller + * + * @return a String containing the full command line + */ + public String getFullCommand() { + return this.fullCommand; + } } diff --git a/frysk-core/frysk/hpd/ParameterizedCommand.java b/frysk-core/frysk/hpd/ParameterizedCommand.java index 0360746..35ec6a6 100644 --- a/frysk-core/frysk/hpd/ParameterizedCommand.java +++ b/frysk-core/frysk/hpd/ParameterizedCommand.java @@ -121,6 +121,10 @@ abstract class ParameterizedCommand extends Command { help(cli, input); return; } + // Don't parse options for start/run command, these are passed on the + // process that is to be started + if (input.getFullCommand().startsWith("run") || + input.getFullCommand().startsWith("start")) break; // Check for <<-option>>; if nothing going give up. String name = optionName(string); if (name == null) diff --git a/frysk-core/frysk/hpd/TestRunCommand.java b/frysk-core/frysk/hpd/TestRunCommand.java index 4c4e761..8608b36 100644 --- a/frysk-core/frysk/hpd/TestRunCommand.java +++ b/frysk-core/frysk/hpd/TestRunCommand.java @@ -104,16 +104,20 @@ public class TestRunCommand extends TestLib { public void testRunCommandParameter() { e = new HpdTestbed(); - String[] param = { "testing", "parameter2"}; + String[] param = { "-testing", "parameter2", "-g"}; e.sendCommandExpectPrompt("load " + Config.getPkgLibFile("funit-parameters").getPath(), "Loaded executable file.*"); - e.sendCommandExpectPrompt("run " + param[0] + " " + param[1], + String parameters = ""; + for (int i = 0; i < param.length; i++) { + parameters = parameters + param[i] + " "; + } + e.sendCommandExpectPrompt("run " + parameters, "Attached to process ([0-9]+).*Running process ([0-9]+).*"); /* * The following wait is added to make the test pass. It seems on a dual-core * machine the funit-parameters process gets put into a different CPU and gets behind * the test case. funit-parameters creates a file that this test checks and when this - * test gets ahead of it that, the test fails beause it cannot find it. Delaying + * test gets ahead of it that, the test fails because it cannot find it. Delaying * 1 second seems to fix that problem. */ try { Thread.sleep(1000); } catch (Exception e) {} hooks/post-receive -- frysk system monitor/debugger