mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-10-19 10:27:22 +02:00
Added a --network option.
This commit is contained in:
parent
5300aff306
commit
7b07de9fcd
@ -119,6 +119,10 @@ if __name__ == '__main__':
|
|||||||
parser.add_option('-O', action='count', dest='optimize',
|
parser.add_option('-O', action='count', dest='optimize',
|
||||||
help='-O optimizes asserts out of the code; ' \
|
help='-O optimizes asserts out of the code; ' \
|
||||||
'-OO optimizes asserts and uses psyco.')
|
'-OO optimizes asserts and uses psyco.')
|
||||||
|
parser.add_option('', '--network', action='store',
|
||||||
|
dest='network', default='',
|
||||||
|
help='network the bot should connect to (instead of '
|
||||||
|
'using the configured default network')
|
||||||
parser.add_option('-n', '--nick', action='store',
|
parser.add_option('-n', '--nick', action='store',
|
||||||
dest='nick', default='',
|
dest='nick', default='',
|
||||||
help='nick the bot should use')
|
help='nick the bot should use')
|
||||||
@ -203,8 +207,9 @@ if __name__ == '__main__':
|
|||||||
user = options.user or conf.supybot.user()
|
user = options.user or conf.supybot.user()
|
||||||
ident = options.ident or conf.supybot.ident()
|
ident = options.ident or conf.supybot.ident()
|
||||||
|
|
||||||
# We could add an option for this, but we'll wait until it's requested.
|
|
||||||
defaultNetwork = conf.supybot.networks.default()
|
defaultNetwork = conf.supybot.networks.default()
|
||||||
|
if options.network:
|
||||||
|
defaultNetwork = options.network
|
||||||
try:
|
try:
|
||||||
network = conf.supybot.networks.get(defaultNetwork)
|
network = conf.supybot.networks.get(defaultNetwork)
|
||||||
except registry.NonExistentRegistryEntry:
|
except registry.NonExistentRegistryEntry:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user