From 6d29da499fbaf1d08c47dd0c8240b19569c9a480 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Mon, 10 Aug 2009 08:25:43 +0000 Subject: [PATCH] Replace neoctl --ip & --port parameters with a single --address. git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1252 71dcc9de-d417-0410-9af5-da40c76e7ee4 --- neoctl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/neoctl b/neoctl index 37327011..b1df0e0e 100755 --- a/neoctl +++ b/neoctl @@ -25,20 +25,23 @@ from neo import setupLog parser = OptionParser() parser.add_option('-v', '--verbose', action = 'store_true', help = 'print verbose messages') -parser.add_option('-p', '--port', help = 'specify the port of admin node', - type='int') -parser.add_option('-i', '--ip', help = 'specify the ip of admin node') +parser.add_option('-a', '--address', help = 'specify the address (ip:port) ' \ + 'of an admin node') parser.add_option('--handler', help = 'specify the connection handler') (options, args) = parser.parse_args() -port = options.port or 5555 -ip = options.ip or '127.0.0.1' +address = options.address +if ':' in address: + address, port = address.split(':', 1) + port = int(port) +else: + port = 5555 handler = options.handler or "SocketConnector" setupLog('NEOCTL', options.verbose) from neo.neoctl.app import Application -app = Application(ip, port, handler) +app = Application(address, port, handler) print app.execute(args) -- 2.30.9