From 6e0145c3b78b9f6d3d60cd9e3702d7ea826e841a Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 7 Aug 2017 00:38:59 -0700 Subject: [PATCH] networks: use nargs='+' instead of manual verification in 'networks' --- plugins/networks.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/networks.py b/plugins/networks.py index 005fcba..27671ab 100644 --- a/plugins/networks.py +++ b/plugins/networks.py @@ -57,7 +57,7 @@ def autoconnect(irc, source, args): remote_parser = utils.IRCParser() remote_parser.add_argument('network') 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 def remote(irc, source, args): """ [--service ] @@ -69,10 +69,6 @@ def remote(irc, source, args): args = remote_parser.parse_args(args) 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... global REMOTE_IN_USE if REMOTE_IN_USE.is_set():