Skip to content

Commit a054bf7

Browse files
committed
more fixes of help displays in docs
1 parent f19e2da commit a054bf7

8 files changed

Lines changed: 16 additions & 16 deletions

File tree

docs/tutorial/commands/one-or-multiple.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $ python main.py Camila
2323
Hello Camila
2424

2525
// Asking for help
26-
$ python main.py
26+
$ python main.py --help
2727

2828
Usage: main.py [OPTIONS] {name}
2929

docs/tutorial/options/help.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ And below you will see other panels for the *CLI options* that have a custom pan
6767
```console
6868
$ python main.py --help
6969

70-
<b> </b><font color="#F4BF75"><b>Usage: </b></font><b>main.py [OPTIONS] name </b>
70+
<b> </b><font color="#F4BF75"><b>Usage: </b></font><b>main.py [OPTIONS] {name} </b>
7171
<b> </b>
7272
Say hi to 'name', optionally with a <font color="#A1EFE4"><b>--lastname</b></font>.
7373
If <font color="#6B9F98"><b>--formal</b></font><font color="#A5A5A1"> is used, say hi very formally. </font>

docs/tutorial/options/required.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ Hello Camila Gutiérrez
5959
// And if you check the help
6060
$ python main.py --help
6161

62+
Usage: main.py [OPTIONS] {name}
63+
6264
Arguments:
6365
name [required]
6466

65-
Usage: main.py [OPTIONS] {name}
66-
6767
Options:
6868
--lastname <str> [required]
6969
--help Show this message and exit.

docs/tutorial/parameter-types/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ $ python main.py Camila --age 15.3
5050
Usage: main.py [OPTIONS] {name}
5151
Try "main.py --help" for help.
5252

53-
Error: Invalid value for '--age': '15.3' is not a valid integer
53+
Error: Invalid value for '--age': '15.3' is not a valid int.
5454

5555
// Because 15.3 is not an integer (it's a float)
5656
```

docs/tutorial/parameter-types/number.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Check it:
1616
$ python main.py --help
1717

1818
// Notice the extra range information in the help text for --age and --score
19-
Usage: main.py [OPTIONS] ID
19+
Usage: main.py [OPTIONS] {ID}
2020

2121
Arguments:
2222
ID [required]
@@ -36,23 +36,23 @@ ID is 5
3636
// Pass an invalid ID
3737
$ python main.py 1002
3838

39-
Usage: main.py [OPTIONS] ID
39+
Usage: main.py [OPTIONS] {ID}
4040
Try "main.py --help" for help.
4141

4242
Error: Invalid value for 'ID': 1002 is not in the range 0<=x<=1000.
4343

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

47-
Usage: main.py [OPTIONS] ID
47+
Usage: main.py [OPTIONS] {ID}
4848
Try "main.py --help" for help.
4949

5050
Error: Invalid value for '--age': 15 is not in the range x>=18.
5151

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

55-
Usage: main.py [OPTIONS] ID
55+
Usage: main.py [OPTIONS] {ID}
5656
Try "main.py --help" for help.
5757

5858
Error: Invalid value for '--score': 100.5 is not in the range x<=100.
@@ -83,7 +83,7 @@ And then, when you pass data that is out of the valid range, it will be "clamped
8383
// ID doesn't have clamp, so it shows an error
8484
$ python main.py 1002
8585

86-
Usage: main.py [OPTIONS] ID
86+
Usage: main.py [OPTIONS] {ID}
8787
Try "main.py --help" for help.
8888

8989
Error: Invalid value for 'ID': 1002 is not in the range 0<=x<=1000.

docs/tutorial/parameter-types/uuid.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ Check it:
3434
// Pass a valid UUID v4
3535
$ python main.py d48edaa6-871a-4082-a196-4daab372d4a1
3636

37-
USER_ID is d48edaa6-871a-4082-a196-4daab372d4a1
37+
User ID is d48edaa6-871a-4082-a196-4daab372d4a1
3838
UUID version is: 4
3939

4040
// An invalid value
4141
$ python main.py 7479706572-72756c6573
4242

43-
Usage: main.py [OPTIONS] USER_ID
43+
Usage: main.py [OPTIONS] {user_id}
4444
Try "main.py --help" for help.
4545

46-
Error: Invalid value for 'USER_ID': 7479706572-72756c6573 is not a valid UUID.
46+
Error: Invalid value for 'user_id': 7479706572-72756c6573 is not a valid UUID.
4747
```
4848

4949
</div>

docs_src/parameter_types/uuid/tutorial001_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@app.command()
99
def main(user_id: UUID):
10-
print(f"USER_ID is {user_id}")
10+
print(f"User ID is {user_id}")
1111
print(f"UUID version is: {user_id.version}")
1212

1313

tests/test_tutorial/test_parameter_types/test_uuid/test_tutorial001.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ def test_type_repr():
2020
def test_main():
2121
result = runner.invoke(app, ["d48edaa6-871a-4082-a196-4daab372d4a1"])
2222
assert result.exit_code == 0
23-
assert "USER_ID is d48edaa6-871a-4082-a196-4daab372d4a1" in result.output
23+
assert "User ID is d48edaa6-871a-4082-a196-4daab372d4a1" in result.output
2424
assert "UUID version is: 4" in result.output
2525

2626

2727
def test_main_with_uuid_object():
2828
user_id = uuid.UUID("d48edaa6-871a-4082-a196-4daab372d4a1")
2929
result = runner.invoke(app, [], default_map={"user_id": user_id})
3030
assert result.exit_code == 0
31-
assert "USER_ID is d48edaa6-871a-4082-a196-4daab372d4a1" in result.output
31+
assert "User ID is d48edaa6-871a-4082-a196-4daab372d4a1" in result.output
3232
assert "UUID version is: 4" in result.output
3333

3434

0 commit comments

Comments
 (0)