-
-
Notifications
You must be signed in to change notification settings - Fork 690
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
explain in docs how to use the str version of show_default for typer.…
…Option
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import typer | ||
|
||
|
||
def main( | ||
fullname: str = typer.Option( | ||
"Wade Wilson", show_default="Deadpoolio the amazing's name" | ||
) | ||
): | ||
print(f"Hello {fullname}") | ||
|
||
|
||
if __name__ == "__main__": | ||
typer.run(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import typer | ||
from typing_extensions import Annotated | ||
|
||
|
||
def main( | ||
fullname: Annotated[ | ||
str, typer.Option(show_default="Deadpoolio the amazing's name") | ||
] = "Wade Wilson" | ||
): | ||
print(f"Hello {fullname}") | ||
|
||
|
||
if __name__ == "__main__": | ||
typer.run(main) |