#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright (c) 2014 Hive Tech, SAS.


'''hivy-watchdog

Usage:
  hivy-watchdog -h | --help
  hivy-watchdog -h | --help
  hivy-watchdog

Options:
  -h --help       Show this screen.
  --version       Show version.
'''


from docopt import docopt

from hivy import __version__
import hivy.conf as conf
from hivy.reactor.handler import SerfHandlerProxy


if __name__ == '__main__':
    args = docopt(
        __doc__, version='Hivy-watchdog, hooks handler %s'.format(__version__))
    print args

    handler = SerfHandlerProxy()
    for role, hook in conf.HOOKS.iteritems():
        handler.register(role, hook())
    handler.run()
