From fbf74148a631a4a0728859fc5746113befbcb887 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 13 Dec 2010 11:31:58 +0100 Subject: [PATCH] reintroduce the 'short' optional parameter for get_command_help() --- weboob/tools/application/repl.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/weboob/tools/application/repl.py b/weboob/tools/application/repl.py index f17d20c8..0f0a41c2 100644 --- a/weboob/tools/application/repl.py +++ b/weboob/tools/application/repl.py @@ -527,7 +527,7 @@ class ReplApplication(Cmd, BaseApplication): print return self.do_quit(arg) - def get_command_help(self, command): + def get_command_help(self, command, short=False): try: doc = getattr(self, 'do_' + command).__doc__ except AttributeError: @@ -536,6 +536,11 @@ class ReplApplication(Cmd, BaseApplication): doc = '\n'.join(line.strip() for line in doc.strip().split('\n')) if not doc.startswith(command): doc = '%s\n\n%s' % (command, doc) + if short: + doc = doc.split('\n')[0] + if not doc.startswith(command): + doc = command + return doc def get_commands_doc(self):