Made description optional.

This commit is contained in:
Jeremy Fincher 2004-07-31 08:05:46 +00:00
parent d8d1b9f445
commit 9772c45af3
1 changed files with 5 additions and 3 deletions

View File

@ -145,15 +145,17 @@ class Bugzilla(callbacks.PrivmsgCommandAndRegexp):
return query
def add(self, irc, msg, args):
"""<name> <url> <description>
"""<name> <url> [<description>]
Add a bugzilla <url> to the list of defined bugzillae. <name>
is the name that will be used to reference the zilla in all
commands. Unambiguous abbreviations of <name> will be accepted also.
<description> is the common name for the bugzilla and will
be listed with the bugzilla query.
be listed with the bugzilla query; if not given, it defaults to <name>.
"""
(name, url, description) = privmsgs.getArgs(args, required=3)
(name, url, description) = privmsgs.getArgs(args,required=2,optional=1)
if not description:
description = name
if url[-1] == '/':
url = url[:-1]
self.db[name] = [url, description]