Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f1b270

Browse files
Bug fix: ? and ! were not full aliases for help' and shell' as implied in
the documentation; the cases `? foo' and `! foo' failed.
1 parent 7a11671 commit 5f1b270

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Lib/cmd.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ def postloop(self):
9090

9191
def onecmd(self, line):
9292
line = string.strip(line)
93-
if line == '?':
94-
line = 'help'
95-
elif line == '!':
93+
if not line:
94+
return self.emptyline()
95+
elif line[0] == '?':
96+
line = 'help ' + line[1:]
97+
elif line[0] == '!':
9698
if hasattr(self, 'do_shell'):
97-
line = 'shell'
99+
line = 'shell ' + line[1:]
98100
else:
99101
return self.default(line)
100-
elif not line:
101-
return self.emptyline()
102102
self.lastcmd = line
103103
i, n = 0, len(line)
104104
while i < n and line[i] in self.identchars: i = i+1

0 commit comments

Comments
 (0)