mirror of https://github.com/tuhiproject/tuhi.git
kete/prompt: filter out EOF from the list of commands in the help
It doesn't make any sense to show this.pull/36/head
parent
72d19ffdad
commit
b33afcce0c
|
@ -531,13 +531,19 @@ class TuhiKeteShell(cmd.Cmd):
|
||||||
self._log_handler = TuhiKeteShellLogHandler()
|
self._log_handler = TuhiKeteShellLogHandler()
|
||||||
logger.removeHandler(logger_handler)
|
logger.removeHandler(logger_handler)
|
||||||
logger.addHandler(self._log_handler)
|
logger.addHandler(self._log_handler)
|
||||||
|
# patching get_names to hide some functions we do not want in the help
|
||||||
|
self.get_names = self._filtered_get_names
|
||||||
|
|
||||||
|
def _filtered_get_names(self):
|
||||||
|
names = super(TuhiKeteShell, self).get_names()
|
||||||
|
names.remove('do_EOF')
|
||||||
|
return names
|
||||||
|
|
||||||
def emptyline(self):
|
def emptyline(self):
|
||||||
# make sure we do not re-enter the last typed command
|
# make sure we do not re-enter the last typed command
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def do_EOF(self, arg):
|
def do_EOF(self, arg):
|
||||||
'''leave the shell'''
|
|
||||||
print('\n\r', end='') # to remove the appended weird char
|
print('\n\r', end='') # to remove the appended weird char
|
||||||
return self.do_exit(arg)
|
return self.do_exit(arg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue