Skip to content

Commit

Permalink
📝 Update console output with Click 8 messages (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
svlandeg committed Apr 7, 2024
1 parent b8ba669 commit 31a15d8
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/tutorial/commands/callback.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $ python main.py create --verbose Camila
Usage: main.py create [OPTIONS] USERNAME
Try "main.py create --help" for help.

Error: no such option: --verbose
Error: No such option: --verbose
```

</div>
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorial/commands/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ Creating user: Camila
// Now test the command delete
$ python main.py delete Camila

# Are you sure you want to delete the user? [y/N]: $ y
# Are you sure you want to delete the user? [y/n]: $ y

Deleting user: Camila

$ python main.py delete Wade

# Are you sure you want to delete the user? [y/N]: $ n
# Are you sure you want to delete the user? [y/n]: $ n

Operation cancelled

Expand All @@ -82,13 +82,13 @@ Operation cancelled

$ python main.py delete-all

# Are you sure you want to delete ALL users? [y/N]: $ y
# Are you sure you want to delete ALL users? [y/n]: $ y

Deleting all users

$ python main.py delete-all

# Are you sure you want to delete ALL users? [y/N]: $ n
# Are you sure you want to delete ALL users? [y/n]: $ n

Operation cancelled

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Hello Ron
// If you pass an invalid number of arguments you will get an error
$ python main.py Draco Hagrid

Error: argument names takes 3 values
Error: Argument 'names' takes 3 values

// And if you pass the exact number of values it will work correctly
$ python main.py Draco Hagrid Dobby
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ The username Morty has 3 coins
// Try with invalid values (not enough)
$ python main.py --user Camila 50

Error: --user option requires 3 arguments
Error: Option '--user' requires 3 arguments
```

</div>
2 changes: 1 addition & 1 deletion docs/tutorial/options/prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ $ python main.py
# Project name: $ Old Project
# Repeat for confirmation: $ New Spice

Error: the two entered values do not match
Error: The two entered values do not match

# Project name: $ Old Project
# Repeat for confirmation: $ Old Project
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/parameter-types/bool.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $ python main.py --no-force
Usage: main.py [OPTIONS]
Try "main.py --help" for help.

Error: no such option: --no-force
Error: No such option: --no-force
```

</div>
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 @@ -38,7 +38,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 'BIRTH:[%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]': 'july-19-1989' does not match the formats '%Y-%m-%d', '%Y-%m-%dT%H:%M:%S', '%Y-%m-%d %H:%M:%S'.
```

</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/parameter-types/enum.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ $ 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': 'capsule' is not one of 'simple', 'conv', 'lstm'.

// Note that enums are case sensitive by default
$ python main.py --network CONV

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

Error: Invalid value for '--network': invalid choice: CONV. (choose from simple, conv, lstm)
Error: Invalid value for '--network': 'CONV' is not one of '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 @@ -50,7 +50,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 @@ -50,23 +50,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 range 0<=x<=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 not in the range x>=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 not in the range x<=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 @@ -110,7 +110,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 range 0<=x<=1000.

// But --rank and --score use clamp
$ python main.py 5 --rank 11 --score -5
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.
```

</div>

0 comments on commit 31a15d8

Please sign in to comment.