summaryrefslogtreecommitdiffstats
path: root/Lib/cmd.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2000-07-11 13:03:55 (GMT)
committerEric S. Raymond <esr@thyrsus.com>2000-07-11 13:03:55 (GMT)
commit5f1b27084aacc2975b3f94e7b225215066f4e1e2 (patch)
treec7cf9fabd85e6d84904e57dc25fc2c57d7a87a9d /Lib/cmd.py
parent7a11671e8b61dcf653d70db714813fba23afc884 (diff)
downloadcpython-5f1b27084aacc2975b3f94e7b225215066f4e1e2.zip
cpython-5f1b27084aacc2975b3f94e7b225215066f4e1e2.tar.gz
cpython-5f1b27084aacc2975b3f94e7b225215066f4e1e2.tar.bz2
Bug fix: ? and ! were not full aliases for `help' and `shell' as implied in
the documentation; the cases `? foo' and `! foo' failed.
Diffstat (limited to 'Lib/cmd.py')
-rw-r--r--Lib/cmd.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/cmd.py b/Lib/cmd.py
index d0c7498..41b2293 100644
--- a/Lib/cmd.py
+++ b/Lib/cmd.py
@@ -90,15 +90,15 @@ class Cmd:
def onecmd(self, line):
line = string.strip(line)
- if line == '?':
- line = 'help'
- elif line == '!':
+ if not line:
+ return self.emptyline()
+ elif line[0] == '?':
+ line = 'help ' + line[1:]
+ elif line[0] == '!':
if hasattr(self, 'do_shell'):
- line = 'shell'
+ line = 'shell ' + line[1:]
else:
return self.default(line)
- elif not line:
- return self.emptyline()
self.lastcmd = line
i, n = 0, len(line)
while i < n and line[i] in self.identchars: i = i+1