-
-
Notifications
You must be signed in to change notification settings - Fork 826
Open
Labels
questionQuestion or problemQuestion or problem
Description
First Check
- I added a very descriptive title to this issue.
- I used the GitHub search to find a similar issue and didn't find it.
- I searched the Typer documentation, with the integrated search.
- I already searched in Google "How to X in Typer" and didn't find any information.
- I already read and followed all the tutorial in the docs and didn't find an answer.
- I already checked if it is not related to Typer but to Click.
Example Code
import typer
app = typer.Typer(result_callback=lambda x: print(x))
@app.command()
def main() -> str:
return "foo"
if __name__ == "__main__":
app()Description
- Create a
Typedinstance - Have only a single
@app.command() - Call the file on the CLI without using the command's name, ie
python test.pyrather thanpython test.py main - The
result_callbackis not called. In the example above, that means nothing is printed to stdout.
Operating System
Linux
Operating System Details
Ubuntu 20.10
Typer Version
0.6.1
Python Version
3.9.5
Metadata
Metadata
Assignees
Labels
questionQuestion or problemQuestion or problem