From 3959f0768b0e2939bccb463c6dddfb1fa429015a Mon Sep 17 00:00:00 2001 From: pdxlocations <117498748+pdxlocations@users.noreply.github.com> Date: Wed, 16 Apr 2025 20:49:17 -0700 Subject: [PATCH] add help option (#171) --- contact/__main__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contact/__main__.py b/contact/__main__.py index 29e1fb5..cb8ca17 100644 --- a/contact/__main__.py +++ b/contact/__main__.py @@ -112,6 +112,11 @@ def main(stdscr: curses.window) -> None: def start() -> None: """Launch curses wrapper and redirect logs to file.""" + + if "--help" in sys.argv or "-h" in sys.argv: + setup_parser().print_help() + sys.exit(0) + with open(config.log_file_path, "a", buffering=1) as log_f: sys.stdout = log_f sys.stderr = log_f