Skip to content

Commit

Permalink
Issue #29: version info
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekmo committed Feb 21, 2018
1 parent a853bb0 commit b31269d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions amazon_dash/management.py
Expand Up @@ -3,6 +3,7 @@

import logging
import click
import sys
from click_default_group import DefaultGroup

CONFIG_FILE = 'amazon-dash.yml'
Expand Down Expand Up @@ -45,13 +46,17 @@ def create_logger(name, level=logging.INFO):
@click.option('--verbose', 'loglevel', help='set logging to COMM',
flag_value=5)
def cli(loglevel):
from amazon_dash import __version__
click.echo('Welcome to Amazon-dash v{} using Python {}'.format(__version__, sys.version.split()[0]))
create_logger('amazon-dash', loglevel)


@cli.command(help='Run server')
@click.option('--config', type=click.Path(), help='Path to config file.', default=CONFIG_FILE)
@click.option('--root-allowed', is_flag=True, default=False)
def run(config, root_allowed):
click.echo('Listening for events. Amazon-dash will execute the events associated with '
'the registered buttons.')
from amazon_dash.listener import Listener
Listener(config).run(root_allowed=root_allowed)

Expand Down
3 changes: 0 additions & 3 deletions scripts/amazon-dash
@@ -1,9 +1,6 @@
#!/usr/bin/env python
import sys

from amazon_dash.exceptions import catch
from amazon_dash.management import cli

if __name__ == "__main__":

catch(cli)()

0 comments on commit b31269d

Please sign in to comment.