You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The help text for that command will be the callback function's docstring: `Manage users in the app.`.
93
93
@@ -127,6 +127,12 @@ Commands:
127
127
128
128
</div>
129
129
130
+
/// note
131
+
132
+
In previous versions of Typer, in addition to the help text, the command name was also inferred from the callback function name, this is no longer the case.
133
+
134
+
///
135
+
130
136
### Help from callback parameter in `typer.Typer()`
131
137
132
138
If you pass a `callback` parameter while creating a `typer.Typer(callback=some_function)` it will be used to infer the help text.
@@ -277,7 +283,7 @@ So, when inferring help text, the precedence order from lowest priority to highe
277
283
278
284
That's for inferring the help text from functions.
279
285
280
-
But if you set the name and help text explicitly, that has a higher priority than these.
286
+
But if you set the help text explicitly, that has a higher priority than these.
281
287
282
288
## Set the name and help
283
289
@@ -345,7 +351,7 @@ Commands:
345
351
346
352
</div>
347
353
348
-
### Name and help in `@app.callback()`
354
+
### Help text in `@app.callback()`
349
355
350
356
Any parameter that you use when creating a `typer.Typer()` app can be overridden in the parameters of `@app.callback()`.
351
357
@@ -439,9 +445,9 @@ Commands:
439
445
440
446
The precedence to generate a command's name and help, from lowest priority to highest, is:
441
447
442
-
* Implicitly inferred from `sub_app = typer.Typer(callback=some_function)`
443
-
* Implicitly inferred from the callback function under `@sub_app.callback()`
444
-
* Implicitly inferred from `app.add_typer(sub_app, callback=some_function)`
448
+
* Implicitly inferred from `sub_app = typer.Typer(callback=some_function)` (only the help text)
449
+
* Implicitly inferred from the callback function under `@sub_app.callback()` (only the help text)
450
+
* Implicitly inferred from `app.add_typer(sub_app, callback=some_function)` (only the help text)
445
451
* Explicitly set on `sub_app = typer.Typer(name="some-name", help="Some help.")`
446
452
* Explicitly set on `@sub_app.callback("some-name", help="Some help.")`
447
453
* Explicitly set on `app.add_typer(sub_app, name="some-name", help="Some help.")`
0 commit comments