diff --git a/bump/cli.py b/bump/cli.py index be7d8e4..7636fed 100644 --- a/bump/cli.py +++ b/bump/cli.py @@ -1,6 +1,8 @@ from typing import Optional import bump import typer +import sys +import select def default( @@ -9,16 +11,23 @@ def default( reset:Optional[bool] = typer.Option(False, help="remove all senders"), alert:Optional[bool] = typer.Option(False, help="check continuously for new messages"), secret:Optional[str] = typer.Option(None, help="change the sender and e2e keys")): + bp = bump.Bump() + + pipe = None + if select.select([sys.stdin,],[],[],0.0)[0]: + pipe = sys.stdin.readline() if message_arg is not None: push(message_arg) + elif pipe is not None: + push(pipe) elif message is not None: push(message) elif secret is not None: secrets(secret) elif reset: delete_senders() - elif alert is not None: + elif alert: alert_process() else: info() diff --git a/setup.py b/setup.py index 720ccf0..94f0ba9 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name='bump_python', packages=['bump'], description='Notify your Phone from Python', - version='0.1.4', + version='0.1.5', url='https://git.maenle.tech/raphael/bump_python', author='Raphael Maenle', author_email='raphael@maenle.net',