3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 20:22:45 +01:00

IRCParser: show an error when using "command --help" instead of silently outputting help text in the console

This commit is contained in:
James Lu 2017-03-06 16:28:38 -08:00
parent 76d74ab9bb
commit ca93d1ad70

View File

@ -558,8 +558,13 @@ class IRCParser(argparse.ArgumentParser):
Wrapper around argparse.ArgumentParser, without quitting on usage errors. 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 <commandname> to receive help for PyLink commands.")
def error(self, message, *args, **kwargs):
raise InvalidArgumentsError(message) raise InvalidArgumentsError(message)
_print_message = error # XXX: ugly
def exit(self, *args): def exit(self, *args):
return return