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
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.
Commit to Help
I commit to help with one of those options 👆
Example Code
importtyperapp=typer.Typer()
@app.command()defhi(name: str):
print("hi ", name)
# I want to do something like thisapp.get_command("hi").options["name"] =typer.Option(..., hidden=True)
# Basically, I want to dynamically manipulate the options of a specific command. Is something like this achievable?
Description
I have a use case, where I want to override the typer command options. Basically, after decorating a function as typer.command()
I want to manipulate the options of this certain command later. Is this possible? I included a minimal example of what I want to do.
Operating System
Linux
Operating System Details
ubuntu 20.04
Typer Version
0.4.1
Python Version
3.8
Additional Context
No response
The text was updated successfully, but these errors were encountered:
From the sidelines: It's generally best practice to pose some minimal version of your specific usecase in issues so as not to fall into the trap of the xy problem.
Though perhaps you could use a callback to solve this issue?
You could, based on the context, modify app commands and call them with variable numbers of parameters?
First Check
Commit to Help
Example Code
Description
I have a use case, where I want to override the typer command options. Basically, after decorating a function as
typer.command()
I want to manipulate the options of this certain command later. Is this possible? I included a minimal example of what I want to do.
Operating System
Linux
Operating System Details
ubuntu 20.04
Typer Version
0.4.1
Python Version
3.8
Additional Context
No response
The text was updated successfully, but these errors were encountered: