public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Fix bz #5793, parameters to run/start not accepting parameters with "-" at beginning.
@ 2008-02-26  4:44 rmoseley
  0 siblings, 0 replies; only message in thread
From: rmoseley @ 2008-02-26  4:44 UTC (permalink / raw)
  To: frysk-cvs

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-26  4:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-26  4:44 [SCM] master: Fix bz #5793, parameters to run/start not accepting parameters with "-" at beginning rmoseley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).