From 51079bbb9420c3b0ed48ab5334f17d00579486c4 Mon Sep 17 00:00:00 2001 From: "Emmanuel C. Jemeni" Date: Sat, 21 Dec 2024 07:34:08 +0100 Subject: [PATCH] feat: update main.py --- TerminalAlert/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/TerminalAlert/main.py b/TerminalAlert/main.py index e37b5f7..7c129a5 100644 --- a/TerminalAlert/main.py +++ b/TerminalAlert/main.py @@ -7,10 +7,10 @@ import time from .utils import check_for_update -__version__ = "1.1.0" +__version__ = "1.2.0" notification = Notify( - default_notification_application_name="TerminalAlert", + default_notification_application_name="TerminalAlert ", default_notification_icon=join(dirname(realpath(__file__)), 'icons', 'logo.png') ) @@ -63,8 +63,8 @@ def terminal_alert(cmd: str) -> None: def main() -> None: - parser = argparse.ArgumentParser(description="Command Completion Alerts – Stay Notified, Stay Productive!") - parser.add_argument("command", help="The command to run.") + parser = argparse.ArgumentParser(description="Command Completion Alerts—Stay Notified, Stay Productive!") + parser.add_argument("command", help="The command to run.", nargs='?') parser.add_argument( "-u", "--update", @@ -78,6 +78,9 @@ def main() -> None: check_for_update(__version__) sys.exit() + if not args.command: + parser.error("the following arguments are required: command") + terminal_alert(args.command)