https://bugzilla.redhat.com/show_bug.cgi?id=710554


I have attached for review a patch to fix this issue.

thanks,

Adam Price

-------- Original Message --------
Subject:        Re: patch for accidentally grabbing '--help' in shell arguments
Date:   Fri, 03 Jun 2011 13:07:04 -0400
From:   Cliff Perry <cpe...@redhat.com>
To:     Satellite Development List <satellite-devel-l...@redhat.com>
CC:     Adam Price <adpr...@redhat.com>, Aron Parsons <apars...@redhat.com>



On 06/03/2011 01:04 PM, Adam Price wrote:
 https://bugzilla.redhat.com/show_bug.cgi?id=710554

 I have attached for review a patch to fix this issue.

Adam,
Aron Parsons maintains spacecmd within the Spacewalk repo (not in
Satellite yet).

Please send this to spacewalk-devel list, cc'ing Aron for review.

Regards,
Cliff


>From bfba37cb7a3a0bd2ea643f5862f64ccab42a353b Mon Sep 17 00:00:00 2001
From: Adam Price <adpr...@redhat.com>
Date: Fri, 3 Jun 2011 12:52:50 -0400
Subject: [PATCH] 710554: patch to fix grabbing '--help' from command
 arguments

---
 spacecmd/src/lib/shell.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/spacecmd/src/lib/shell.py b/spacecmd/src/lib/shell.py
index c95655b..df437e8 100644
--- a/spacecmd/src/lib/shell.py
+++ b/spacecmd/src/lib/shell.py
@@ -126,8 +126,10 @@ class SpacewalkShell(Cmd):
             args = ''
 
         # print the help message if the user passes '--help'
-        if re.search('--help', line):
-            return 'help %s' % command
+        line_parts = line.split("\"")
+        for i in range(0, len(line_parts), 2):
+            if re.search('--help', line):
+                return 'help %s' % command
 
         # should we look for an item in the history?
         if command[0] != '!' or len(command) < 2:
-- 
1.7.4.4

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to