Skip to content

Commit 00978cc

Browse files
committed
Simplify the launcher
Importing the `main()` function is likely more common and concise than relying on the heavy-weight `app` object to be callable.
1 parent 01a7007 commit 00978cc

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

source/guides/creating-command-line-tools.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ so initialize the command-line interface here:
9090

9191
.. code-block:: python
9292
93-
if __name__ == "__main__":
94-
from greetings.cli import app
95-
app()
93+
import sys
94+
95+
if __name__ == "__main__":
96+
from greetings.cli import main
97+
98+
sys.exit(main())
9699
97100
.. note::
98101

0 commit comments

Comments
 (0)