Add suggestion of commands in case of if "unknown"
Very useful to find the good short alias...
This commit is contained in:
parent
37c68b7ba6
commit
d0c7a18d20
1 changed files with 4 additions and 0 deletions
|
|
@ -377,6 +377,10 @@ class ReplApplication(Cmd, ConsoleApplication):
|
|||
|
||||
def default(self, line):
|
||||
print >>sys.stderr, 'Unknown command: "%s"' % line
|
||||
cmd, arg, ignore = Cmd.parseline(self, line)
|
||||
names = set(name[3:] for name in self.get_names() if name.startswith('do_' + cmd))
|
||||
if len(names) > 0:
|
||||
print >>sys.stderr, 'Do you mean %s?' % ' '.join(names)
|
||||
return 2
|
||||
|
||||
def completenames(self, text, *ignored):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue