From 547cec62c234e3c1c704148c0359b1eeb7d4ae3d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 15 Aug 2024 22:00:16 -0400 Subject: [PATCH] Add docstring for main. --- jaraco/ui/main.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/jaraco/ui/main.py b/jaraco/ui/main.py index 02dd9b2..05ecf2c 100644 --- a/jaraco/ui/main.py +++ b/jaraco/ui/main.py @@ -3,6 +3,18 @@ def main(func, app=typer.Typer(add_completion=False)): + """ + Decorator and wrapper around typer to mark a function as main. + + For example: + + @main + def run(...): + ... + + Use of this decorator outside of the same module will not have + the intended effect. + """ if named.get_module(func) == '__main__': app.command()(func) app()