mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-11 20:52:42 +01:00
networks: use nargs='+' instead of manual verification in 'networks'
This commit is contained in:
parent
075b746f32
commit
6e0145c3b7
@ -57,7 +57,7 @@ def autoconnect(irc, source, args):
|
|||||||
remote_parser = utils.IRCParser()
|
remote_parser = utils.IRCParser()
|
||||||
remote_parser.add_argument('network')
|
remote_parser.add_argument('network')
|
||||||
remote_parser.add_argument('--service', type=str, default='pylink')
|
remote_parser.add_argument('--service', type=str, default='pylink')
|
||||||
remote_parser.add_argument('command', nargs=utils.IRCParser.REMAINDER)
|
remote_parser.add_argument('command', nargs='+')
|
||||||
@utils.add_cmd
|
@utils.add_cmd
|
||||||
def remote(irc, source, args):
|
def remote(irc, source, args):
|
||||||
"""<network> [--service <service name>] <command>
|
"""<network> [--service <service name>] <command>
|
||||||
@ -69,10 +69,6 @@ def remote(irc, source, args):
|
|||||||
args = remote_parser.parse_args(args)
|
args = remote_parser.parse_args(args)
|
||||||
netname = args.network
|
netname = args.network
|
||||||
|
|
||||||
if not args.command:
|
|
||||||
irc.error("No command specified!")
|
|
||||||
return
|
|
||||||
|
|
||||||
# XXX: things like 'remote network1 remote network2 echo hi' will crash PyLink if the source network is network1...
|
# XXX: things like 'remote network1 remote network2 echo hi' will crash PyLink if the source network is network1...
|
||||||
global REMOTE_IN_USE
|
global REMOTE_IN_USE
|
||||||
if REMOTE_IN_USE.is_set():
|
if REMOTE_IN_USE.is_set():
|
||||||
|
Loading…
Reference in New Issue
Block a user