Is it possible to include a Prolog in --help
#1342
-
First Check
Commit to Help
Example Code`--help`DescriptionI have seen it is possible to add an epilog to the Would it be possible to add a custom Prolog above the "Usage..." line too? Operating SystemLinux Operating System DetailsNo response Typer Version0.7.0 Python VersionPython 3.11.0 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Here is one way (overriding |
Beta Was this translation helpful? Give feedback.
-
|
Maybe this needs to be a separate ticket, but I would like to be able to call a custom function in either prolog or epilog. The reason is that I use rich to create a table of data sources that can be accessed by various commands; I can't just dump that table into a decorator (as far as I know). Ideally I could just add a @prolog or @epilog decorator to a function, and let it do whatever it wants. |
Beta Was this translation helpful? Give feedback.
Here is one way (overriding
get_usagefrom the defaultTyperGroupcls):You could also use the
format_usage.