From cb320a86640d8ce4bf3ab45f14d873405c2e87af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hauke=20Z=C3=BChl?= Date: Sat, 19 Sep 2026 11:50:37 +0200 Subject: [PATCH] =?UTF-8?q?Argumentparser=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/muell.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/python/muell.py b/python/muell.py index 91b9643..5646b4b 100644 --- a/python/muell.py +++ b/python/muell.py @@ -1,9 +1,29 @@ #!/usr/bin/python3 +import argparse + from Muell import Muell if __name__ == '__main__': - muell = Muell() + + parser = argparse.ArgumentParser( + prog='muell', + description='Benachrichtigt Empfänger über anstehende Müllabfuhr' + ) + parser.add_argument('-c', '--config', default='.muell.yaml', help='Name der Konfigdatei. Diese muss sich im Benutzerverzeichnis befinden!') + parser.add_argument('-t', '--telegram', action='store_true', help='Ausgabe auf Telegram') + parser.add_argument('-s', '--signal', action='store_true', help='Ausgabe auf Signal') + parser.add_argument('-k', '--konsole', action='store_true', help='Ausgabe auf Konsole') + args = parser.parse_args() + + muell = Muell(args.config) ausgabe = muell.get_data() - muell.ausgabe_telegram(ausgabe) - muell.ausgabe_signal(ausgabe) + + if args.telegram == True: + muell.ausgabe_telegram(ausgabe) + + if args.signal == True: + muell.ausgabe_signal(ausgabe) + + if args.konsole == True: + muell.ausgabe_text(ausgabe)