This is the mail archive of the
frysk-cvs@sources.redhat.com
mailing list for the frysk project.
[SCM] master: Fix bz #5793, parameters to run/start not accepting parameters with "-" at beginning.
- From: rmoseley at sourceware dot org
- To: frysk-cvs at sourceware dot org
- Date: 26 Feb 2008 04:44:39 -0000
- Subject: [SCM] master: Fix bz #5793, parameters to run/start not accepting parameters with "-" at beginning.
- Reply-to: frysk at sourceware dot org
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 <rmoseley@localhost.localdomain>
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 <rmoseley@redhat.com>
+
+ * 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 <cagney@redhat.com>
* 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