def run_ginkgoctl():
    parser = argparse.ArgumentParser(prog="ginkgoctl")
    parser.add_argument("-v", "--version",
        action="version", version="%(prog)s {}".format(ginkgo.__version__))
    parser.add_argument("-p", "--pid", help="""
        pid or pidfile to use instead of target
        """.strip())
    parser.add_argument("target", nargs='?', help="""
        service class path to use (modulename.ServiceClass) or
        configuration file path to use (/path/to/config.py)
        """.strip())
    parser.add_argument("action",
        choices="start stop restart reload status log logtail".split())
    args = parser.parse_args()
    if args.pid and args.target:
        parser.error("You cannot specify both a target and a pid")
    try:
        if args.action in "start restart log logtail".split():
            if not args.target:
                parser.error("You need to specify a target for {}".format(args.action))
            getattr(ControlInterface(), args.action)(args.target)
        else:
            getattr(ControlInterface(), args.action)(resolve_pid(args.pid, args.target))
    except __HOLE__, e:
        parser.error(e)
dataset/ETHPy150Open progrium/ginkgo/ginkgo/runner.py/run_ginkgoctl