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
Typer is a CLI python package built on click, so it stands to reason that this project should work just fine with CLIs built with typer.
Here's the output of the command to generate man pages :
poetry run click-man --target ./man my-cli
Load entry point my-cli
Error: Could not find click.Command object for"my-cli".
The entry point points to a typer.Typer instance. The click object can be fetched using typer.main.get_command(app: typer.Typer), which should make it trivial to make the app work.
I've tried to make it work myself :
In my main CLI, I've stored the return value of typer.main.get_command(app) where app is my typer.Typer() instance to a variable
In poetry, I've set the entry point for my cli to that variable
I've then run poetry run click-man --target ./man my-cli on it
I may try to import click-man in my poetry scripts and run it using poetry run gen-man or something, in order to make it work, but having typer support out of the box would be great.
The text was updated successfully, but these errors were encountered:
importtyperfromclick_man.coreimportwrite_man_pagesfromcliimportapp, __version__defmake_man():
'''Generates man pages for the CLI'''cli=typer.main.get_command(app)
name='cli'version=__version__target_dir='./man'write_man_pages(name, cli, version=version, target_dir=target_dir)
return
That code snippet seems to work just fine to generate man pages for my typer CLI
Typer is a CLI python package built on click, so it stands to reason that this project should work just fine with CLIs built with typer.
Here's the output of the command to generate man pages :
The entry point points to a
typer.Typer
instance. The click object can be fetched usingtyper.main.get_command(app: typer.Typer)
, which should make it trivial to make the app work.I've tried to make it work myself :
typer.main.get_command(app)
where app is mytyper.Typer()
instance to a variablepoetry run click-man --target ./man my-cli
on itI may try to import click-man in my poetry scripts and run it using
poetry run gen-man
or something, in order to make it work, but having typer support out of the box would be great.The text was updated successfully, but these errors were encountered: