public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
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.
Date: Tue, 26 Feb 2008 04:44:00 -0000	[thread overview]
Message-ID: <20080226044439.29126.qmail@sourceware.org> (raw)

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


                 reply	other threads:[~2008-02-26  4:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080226044439.29126.qmail@sourceware.org \
    --to=rmoseley@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).