From ca93d1ad701bad48037e813fc57593240ddd5bd3 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 6 Mar 2017 16:28:38 -0800 Subject: [PATCH] IRCParser: show an error when using "command --help" instead of silently outputting help text in the console --- utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index c17ab8f..39703d0 100644 --- a/utils.py +++ b/utils.py @@ -558,8 +558,13 @@ class IRCParser(argparse.ArgumentParser): Wrapper around argparse.ArgumentParser, without quitting on usage errors. """ - def error(self, message): + def print_help(self, *args, **kwargs): + # XXX: find a way to somehow route this through IRC + raise InvalidArgumentsError("Use help to receive help for PyLink commands.") + + def error(self, message, *args, **kwargs): raise InvalidArgumentsError(message) + _print_message = error # XXX: ugly def exit(self, *args): return