Ravi Nori has uploaded a new change for review.

Change subject: cli: connect --help will log the user out of the disconnected 
cli
......................................................................

cli: connect --help will log the user out of the disconnected cli

Running connect --help in a disconnect cli will print help message
and log user off cli.

This patch uses a regex to convert command --help to
help command and execute it.

Change-Id: Icffe101260edc5072aec4c8d2a6df0f763591f8b
Bug-Url: https://bugzilla.redhat.com/890340
Signed-off-by: Ravi Nori <rn...@redhat.com>
---
M src/ovirtcli/shell/engineshell.py
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-cli refs/changes/94/13494/1

diff --git a/src/ovirtcli/shell/engineshell.py 
b/src/ovirtcli/shell/engineshell.py
index 394217d..d968e66 100644
--- a/src/ovirtcli/shell/engineshell.py
+++ b/src/ovirtcli/shell/engineshell.py
@@ -20,6 +20,7 @@
 import cmd
 import signal
 import readline
+import re
 
 from ovirtcli.shell.actioncmdshell import ActionCmdShell
 from ovirtcli.shell.connectcmdshell import ConnectCmdShell
@@ -103,6 +104,10 @@
 
     def onecmd(self, s):
         if not s.startswith('#'):
+            rg = re.compile('((?:[a-z][a-z]+))( 
)(-)(-)(help)',re.IGNORECASE|re.DOTALL)
+            m = rg.search(s)
+            if m:
+                s = 'help ' + m.group(1)
             command = s.split(' ')[0]
             if command == '' and not self.__input_buffer:
                 pass


--
To view, visit http://gerrit.ovirt.org/13494
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icffe101260edc5072aec4c8d2a6df0f763591f8b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <rn...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to