diff --git a/docs/tutorial/options/name.md b/docs/tutorial/options/name.md index e25e1a9..cf037b8 100644 --- a/docs/tutorial/options/name.md +++ b/docs/tutorial/options/name.md @@ -3,14 +3,14 @@ By default **Typer** will create a *CLI option* name from the function parameter So, if you have a function with: ```Python -def main(user_name: str = None): +def main(user_name: Optional[str] = None): pass ``` or ```Python -def main(user_name: str = typer.Option(None)): +def main(user_name: Optional[str] = typer.Option(None)): pass ``` diff --git a/docs/tutorial/options/version.md b/docs/tutorial/options/version.md index b94ccf7..4002669 100644 --- a/docs/tutorial/options/version.md +++ b/docs/tutorial/options/version.md @@ -6,7 +6,7 @@ It would show the version of your CLI program and then it would terminate it. Ev Let's see a first version of how it could look like: -```Python hl_lines="6 7 8 9 14" +```Python hl_lines="8-11 16-18" {!../docs_src/options/version/tutorial001.py!} ``` @@ -57,7 +57,7 @@ Awesome CLI Version: 0.1.0 But now let's say that the `--name` *CLI option* that we declared before `--version` is required, and it has a callback that could exit the program: -```Python hl_lines="12 13 14 18" +```Python hl_lines="14-16 21-23" {!../docs_src/options/version/tutorial002.py!} ``` @@ -89,7 +89,7 @@ For those cases, we can mark a *CLI parameter* (a *CLI option* or *CLI argument* That will tell **Typer** (actually Click) that it should process this *CLI parameter* before the others: -```Python hl_lines="21" +```Python hl_lines="22-24" {!../docs_src/options/version/tutorial003.py!} ``` diff --git a/docs/tutorial/parameter-types/bool.md b/docs/tutorial/parameter-types/bool.md index a0d0892..26629ac 100644 --- a/docs/tutorial/parameter-types/bool.md +++ b/docs/tutorial/parameter-types/bool.md @@ -60,7 +60,7 @@ We might want to instead have `--accept` and `--reject`. We can do that by passing a single `str` with the 2 names for the `bool` *CLI option* separated by `/`: -```Python hl_lines="4" +```Python hl_lines="6" {!../docs_src/parameter_types/bool/tutorial002.py!} ``` diff --git a/docs/tutorial/parameter-types/path.md b/docs/tutorial/parameter-types/path.md index 89ae996..887ab37 100644 --- a/docs/tutorial/parameter-types/path.md +++ b/docs/tutorial/parameter-types/path.md @@ -2,7 +2,7 @@ You can declare a *CLI parameter* to be a standard Python