Commit 6d29da49 authored by Vincent Pelletier's avatar Vincent Pelletier

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
parent 92786b97
...@@ -25,20 +25,23 @@ from neo import setupLog ...@@ -25,20 +25,23 @@ from neo import setupLog
parser = OptionParser() parser = OptionParser()
parser.add_option('-v', '--verbose', action = 'store_true', parser.add_option('-v', '--verbose', action = 'store_true',
help = 'print verbose messages') help = 'print verbose messages')
parser.add_option('-p', '--port', help = 'specify the port of admin node', parser.add_option('-a', '--address', help = 'specify the address (ip:port) ' \
type='int') 'of an admin node')
parser.add_option('-i', '--ip', help = 'specify the ip of admin node')
parser.add_option('--handler', help = 'specify the connection handler') parser.add_option('--handler', help = 'specify the connection handler')
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
port = options.port or 5555 address = options.address
ip = options.ip or '127.0.0.1' if ':' in address:
address, port = address.split(':', 1)
port = int(port)
else:
port = 5555
handler = options.handler or "SocketConnector" handler = options.handler or "SocketConnector"
setupLog('NEOCTL', options.verbose) setupLog('NEOCTL', options.verbose)
from neo.neoctl.app import Application from neo.neoctl.app import Application
app = Application(ip, port, handler) app = Application(address, port, handler)
print app.execute(args) print app.execute(args)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment