#!/usr/bin/env python
# -*- coding: utf-8 -*-

import subprocess
from optparse import OptionParser

parser = OptionParser()
parser.add_option("-p", "--port", dest="port", help="service port", default=8083) 
(options, args) = parser.parse_args()

if len(args) == 0:
    print('Please use one of the following \
        command (start|stop|restart|status)')
    exit(1)

command = args.pop(0)

if not command in ['start', 'stop', 'restart', 'status']:
    print('Please use one of the following \
        command (start|stop|restart|status)')
    exit(1)
services = ['lxxl.wildbull', 'lxxl.graph', 'lxxl.authentication.front', 'lxxl.authentication.admin']

for service in services:
    subprocess.call("%s %s" % (service, command), shell=True)
