Skip to content

Commit

Permalink
📝 Update docs to keep them in sync with actual output
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Mar 10, 2020
1 parent 83e78e8 commit 0f33035
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ $ python main.py
Usage: main.py [OPTIONS] NAME
Try "main.py --help" for help.

Error: Missing argument "NAME".
Error: Missing argument 'NAME'.

// You get a --help for free
$ python main.py --help
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ $ python main.py
Usage: main.py [OPTIONS] NAME
Try "main.py --help" for help.

Error: Missing argument "NAME".
Error: Missing argument 'NAME'.

// You get a --help for free
$ python main.py --help
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ $ python main.py
Usage: main.py [OPTIONS] NAME
Try "main.py --help" for help.

Error: Missing argument "NAME".
Error: Missing argument 'NAME'.
```

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ $ python main.py
Usage: main.py [OPTIONS] NAME
Try "main.py --help" for help.

Error: Missing argument "NAME".
Error: Missing argument 'NAME'.

// With the NAME CLI argument
$ python main.py Camila
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/commands/one-or-multiple.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ python main.py
Usage: main.py [OPTIONS] NAME
Try "main.py --help" for help.

Error: Missing argument "NAME".
Error: Missing argument 'NAME'.

// With the NAME CLI argument
$ python main.py Camila
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ $ python main.py
Usage: main.py [OPTIONS] NAME
Try "main.py --help" for help.

Error: Missing argument "NAME".
Error: Missing argument 'NAME'.

// Now pass that NAME CLI argument
$ python main.py Camila
Expand Down Expand Up @@ -128,7 +128,7 @@ $ python main.py Camila
Usage: main.py [OPTIONS] NAME LASTNAME
Try "main.py --help" for help.

Error: Missing argument "LASTNAME".
Error: Missing argument 'LASTNAME'.

// These 2 arguments are required, so, pass both:
$ python main.py Camila Gutiérrez
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/options/required.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ python main.py Camila
Usage: main.py [OPTIONS] NAME
Try "main.py --help" for help.

Error: Missing option "--lastname".
Error: Missing option '--lastname'.

// Now update it to pass the required --lastname CLI option
$ python main.py Camila --lastname Gutiérrez
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/parameter-types/datetime.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $ python main.py july-19-1989

Usage: main.py [OPTIONS] [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d%H:%M:%S]

Error: Invalid value for "[%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]": invalid datetime format: july-19-1989. (choose from %Y-%m-%d, %Y-%m-%dT%H:%M:%S, %Y-%m-%d %H:%M:%S)
Error: Invalid value for '[%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]': invalid datetime format: july-19-1989. (choose from %Y-%m-%d, %Y-%m-%dT%H:%M:%S, %Y-%m-%d %H:%M:%S)
```

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/parameter-types/enum.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ python main.py --network capsule
Usage: main.py [OPTIONS]
Try "main.py --help" for help.

Error: Invalid value for "--network": invalid choice: capsule. (choose from simple, conv, lstm)
Error: Invalid value for '--network': invalid choice: capsule. (choose from simple, conv, lstm)
```

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/parameter-types/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $ python main.py Camila --age 15.3
Usage: main.py [OPTIONS] NAME
Try "main.py --help" for help.

Error: Invalid value for "--age": 15.3 is not a valid integer
Error: Invalid value for '--age': 15.3 is not a valid integer

// Because 15.3 is not an INTEGER (it's a float)
```
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorial/parameter-types/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ $ python main.py 1002
Usage: main.py [OPTIONS] ID
Try "main.py --help" for help.

Error: Invalid value for "ID": 1002 is not in the valid range of 0 to 1000.
Error: Invalid value for 'ID': 1002 is not in the valid range of 0 to 1000.

// Pass an invalid age
$ python main.py 5 --age 15

Usage: main.py [OPTIONS] ID
Try "main.py --help" for help.

Error: Invalid value for "--age": 15 is smaller than the minimum valid value 18.
Error: Invalid value for '--age': 15 is smaller than the minimum valid value 18.

// Pass an invalid score
$ python main.py 5 --age 20 --score 100.5

Usage: main.py [OPTIONS] ID
Try "main.py --help" for help.

Error: Invalid value for "--score": 100.5 is bigger than the maximum valid value 100.
Error: Invalid value for '--score': 100.5 is bigger than the maximum valid value 100.

// But as we didn't specify a minimum score, this is accepted
$ python main.py 5 --age 20 --score -5
Expand Down Expand Up @@ -87,7 +87,7 @@ $ python main.py 1002
Usage: main.py [OPTIONS] ID
Try "main.py --help" for help.

Error: Invalid value for "ID": 1002 is not in the valid range of 0 to 1000.
Error: Invalid value for 'ID': 1002 is not in the valid range of 0 to 1000.

// But --rank and --score use clamp
$ python main.py 5 --rank 11 --score -5
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/parameter-types/path.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ $ python main.py --config config.txt
Usage: main.py [OPTIONS]
Try "main.py --help" for help.

Error: Invalid value for "--config": File "config.txt" does not exist.
Error: Invalid value for '--config': File 'config.txt' does not exist.

// Now create a quick config
$ echo "some settings" > config.txt
Expand All @@ -89,7 +89,7 @@ $ python main.py --config ./
Usage: main.py [OPTIONS]
Try "main.py --help" for help.

Error: Invalid value for "--config": File "./" is a directory.
Error: Invalid value for '--config': File './' is a directory.
```

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/parameter-types/uuid.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $ python main.py 7479706572-72756c6573
Usage: main.py [OPTIONS] USER_ID
Try "main.py --help" for help.

Error: Invalid value for "USER_ID": 7479706572-72756c6573 is not a valid UUID value
Error: Invalid value for 'USER_ID': 7479706572-72756c6573 is not a valid UUID value
```

</div>

1 comment on commit 0f33035

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.