From 73ef95f42a086a274c5b9546e44eb6a61878aa2d Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 16 Apr 2018 02:13:59 -0400 Subject: [PATCH] Add `pikerd` entry point --- piker/cli.py | 12 ++++++++++++ setup.py | 1 + 2 files changed, 13 insertions(+) diff --git a/piker/cli.py b/piker/cli.py index 171a71d8..c6342eec 100644 --- a/piker/cli.py +++ b/piker/cli.py @@ -35,6 +35,18 @@ def run(main, loglevel='info'): log.debug("Exiting piker") +@click.command() +@click.option('--broker', '-b', default=DEFAULT_BROKER, + help='Broker backend to use') +@click.option('--loglevel', '-l', default='warning', help='Logging level') +def pikerd(broker, loglevel): + """Spawn the piker daemon. + """ + from piker.brokers.core import _daemon_main + brokermod = get_brokermod(broker) + run(partial(_daemon_main, brokermod), loglevel) + + @click.group() def cli(): pass diff --git a/setup.py b/setup.py index 07d86eb4..3f9f7416 100755 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ setup( entry_points={ 'console_scripts': [ 'piker = piker.cli:cli', + 'pikerd = piker.cli:pikerd', ] }, install_requires=[