@@ -102,9 +102,9 @@ so initizalize the command-line interface here:
102
102
103
103
.. code-block :: python
104
104
105
- if __name__ == " __main__" :
106
- from greetings.cli import app
107
- app()
105
+ if __name__ == " __main__" :
106
+ from greetings.cli import app
107
+ app()
108
108
109
109
.. note ::
110
110
@@ -123,8 +123,8 @@ For the project to be recognised as a command-line tool, additionally a ``consol
123
123
124
124
.. code-block :: toml
125
125
126
- [project.scripts]
127
- greet = "greetings.cli:app"
126
+ [project.scripts]
127
+ greet = "greetings.cli:app"
128
128
129
129
Now, the project's source tree is ready to be transformed into a :term: `distribution package <Distribution Package> `,
130
130
which makes it installable.
@@ -145,12 +145,12 @@ Let's test it:
145
145
146
146
.. code-block :: console
147
147
148
- $ greet --knight Lancelot
149
- Greetings, dear Sir Lancelot!
150
- $ greet --gender feminine Parks
151
- Greetings, dear Ms. Parks!
152
- $ greet --gender masculine
153
- Greetings, dear Mr. what's-his-name!
148
+ $ greet --knight Lancelot
149
+ Greetings, dear Sir Lancelot!
150
+ $ greet --gender feminine Parks
151
+ Greetings, dear Ms. Parks!
152
+ $ greet --gender masculine
153
+ Greetings, dear Mr. what's-his-name!
154
154
155
155
Since this example uses ``typer ``, you could now also get an overview of the program's usage by calling it with
156
156
the ``--help `` option, or configure completions via the ``--install-completion `` option.
@@ -160,7 +160,7 @@ To just run the program without installing it permanently, use ``pipx run``, whi
160
160
161
161
.. code-block :: console
162
162
163
- $ pipx run --spec . greet --knight
163
+ $ pipx run --spec . greet --knight
164
164
165
165
This syntax is a bit unpractical, however; as the name of the entry point we defined above does not match the package name,
166
166
we need to state explicitly which executable script to run (even though there is only on in existence).
0 commit comments