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
Copy file name to clipboardExpand all lines: docs/tutorial/arguments/optional.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ name: str
113
113
114
114
Now, finally what we came for, an optional *CLI argument*.
115
115
116
-
To make a *CLI argument* optional, use `typer.Argument()`and pass a different "default" as the first parameter to `typer.Argument()`, for example `None`:
116
+
To make a *CLI argument* optional, use `Optional[X]` type for `Annotated`and provide a "default" value for function parameter, for example `None`:
0 commit comments