mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Bug fix: ? and ! were not full aliases for help' and
shell' as implied in
the documentation; the cases `? foo' and `! foo' failed.
This commit is contained in:
parent
7a11671e8b
commit
5f1b27084a
1 changed files with 6 additions and 6 deletions
12
Lib/cmd.py
12
Lib/cmd.py
|
@ -90,15 +90,15 @@ class Cmd:
|
||||||
|
|
||||||
def onecmd(self, line):
|
def onecmd(self, line):
|
||||||
line = string.strip(line)
|
line = string.strip(line)
|
||||||
if line == '?':
|
if not line:
|
||||||
line = 'help'
|
return self.emptyline()
|
||||||
elif line == '!':
|
elif line[0] == '?':
|
||||||
|
line = 'help ' + line[1:]
|
||||||
|
elif line[0] == '!':
|
||||||
if hasattr(self, 'do_shell'):
|
if hasattr(self, 'do_shell'):
|
||||||
line = 'shell'
|
line = 'shell ' + line[1:]
|
||||||
else:
|
else:
|
||||||
return self.default(line)
|
return self.default(line)
|
||||||
elif not line:
|
|
||||||
return self.emptyline()
|
|
||||||
self.lastcmd = line
|
self.lastcmd = line
|
||||||
i, n = 0, len(line)
|
i, n = 0, len(line)
|
||||||
while i < n and line[i] in self.identchars: i = i+1
|
while i < n and line[i] in self.identchars: i = i+1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue