File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ $ python main.py --help
2323Usage: main.py [OPTIONS] [name]
2424
2525Arguments:
26- name [env var: AWESOME_NAME;default: World]
26+ name [env var: AWESOME_NAME; default: World]
2727
2828Options:
2929 --help Show this message and exit.
@@ -68,7 +68,7 @@ $ python main.py --help
6868Usage: main.py [OPTIONS] [name]
6969
7070Arguments:
71- name [env var: AWESOME_NAME, GOD_NAME;default: World]
71+ name [env var: AWESOME_NAME, GOD_NAME; default: World]
7272
7373Options:
7474 --help Show this message and exit.
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ $ python main.py --help
207207<font color="#A5A5A1">╰───────────────────────────────────────────────────────────────────╯</font>
208208<font color="#A5A5A1">╭─ Secondary Arguments ─────────────────────────────────────────────╮</font>
209209<font color="#A5A5A1">│ lastname </font><font color="#A37F4E"><b>lastname</b></font> The last name │
210- <font color="#A5A5A1">│ age </font><font color="#A37F4E"><b>age </b></font> The user's age │
210+ <font color="#A5A5A1">│ age </font><font color="#A37F4E"><b>age </b></font> The user's age │
211211<font color="#A5A5A1">╰───────────────────────────────────────────────────────────────────╯</font>
212212<font color="#A5A5A1">╭─ Options ─────────────────────────────────────────────────────────╮</font>
213213<font color="#A5A5A1">│ </font><font color="#A1EFE4"><b>--help</b></font> Show this message and exit. │
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ Usage: main.py [OPTIONS] COMMAND [ARGS]...
4040 Manage users in the awesome CLI app.
4141
4242Options:
43- --verbose / --no-verbose [default: False ]
43+ --verbose / --no-verbose [default: no-verbose ]
4444 --install-completion Install completion for the current shell.
4545 --show-completion Show completion for the current shell, to copy it or customize the installation.
4646 --help Show this message and exit.
Original file line number Diff line number Diff line change @@ -424,7 +424,7 @@ $ python main.py create --help
424424<font color="#A5A5A1">│ </font><font color="#A1EFE4"><b>--help</b></font> Show this message and exit. │
425425<font color="#A5A5A1">╰───────────────────────────────────────────────────────────────────╯</font>
426426<font color="#A5A5A1">╭─ Additional Data ─────────────────────────────────────────────────╮</font>
427- <font color="#A5A5A1">│ </font><font color="#A1EFE4"><b>--age</b></font> <font color="#F4BF75"><b>INTEGER </b></font> The age of the new user │
427+ <font color="#A5A5A1">│ </font><font color="#A1EFE4"><b>--age</b></font> <font color="#F4BF75"><b><int> </b></font> The age of the new user │
428428<font color="#A5A5A1">│ </font><font color="#A1EFE4"><b>--favorite-color</b></font> <font color="#F4BF75"><b><str> </b></font> The favorite color of the new │
429429<font color="#A5A5A1">│ user │</font>
430430<font color="#A5A5A1">╰───────────────────────────────────────────────────────────────────╯</font>
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ Arguments:
4141 name [required]
4242
4343Options:
44- --lastname <str> Last name of person to greet. [default: ]
45- --formal / --no-formal Say hi formally. [default: False ]
44+ --lastname <str> Last name of person to greet.
45+ --formal / --no-formal Say hi formally. [default: no-formal ]
4646 --help Show this message and exit.
4747
4848// Now you have a help text for the --lastname and --formal CLI options 🎉
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ $ python main.py --help
2424Usage: main.py [OPTIONS]
2525
2626Options:
27- --force [default: False]
27+ --force
2828 --help Show this message and exit.
2929
3030// Try it:
@@ -113,7 +113,7 @@ $ python main.py --help
113113Usage: main.py [OPTIONS]
114114
115115Options:
116- -f, --force / -F, --no-force [default: False ]
116+ -f, --force / -F, --no-force [default: no-force ]
117117 --help Show this message and exit.
118118
119119// Try with the short name -f
Original file line number Diff line number Diff line change @@ -23,17 +23,17 @@ And here's how it looks like:
2323``` console
2424$ python main.py --help
2525
26- // Notice how --age is an INTEGER and --height-meters is a FLOAT
26+ // Notice how --age is an 'int' (integer) and --height-meters is a 'float'
2727Usage: main.py [OPTIONS] {name}
2828
2929Arguments:
3030 name [required]
3131
3232Options:
33- --age INTEGER [default: 20]
34- --height-meters FLOAT [default: 1.89]
35- --female / --no-female [default: True ]
36- --help Show this message and exit.
33+ --age <int> [default: 20]
34+ --height-meters <float> [default: 1.89]
35+ --female / --no-female [default: female ]
36+ --help Show this message and exit.
3737
3838// Call it with CLI parameters
3939$ python main.py Camila --age 15 --height-meters 1.70 --female
@@ -52,7 +52,7 @@ Try "main.py --help" for help.
5252
5353Error: Invalid value for '--age': '15.3' is not a valid integer
5454
55- // Because 15.3 is not an INTEGER (it's a float)
55+ // Because 15.3 is not an integer (it's a float)
5656```
5757
5858</div >
Original file line number Diff line number Diff line change @@ -15,16 +15,16 @@ Check it:
1515``` console
1616$ python main.py --help
1717
18- // Notice the extra RANGE in the help text for --age and --score
18+ // Notice the extra range information in the help text for --age and --score
1919Usage: main.py [OPTIONS] ID
2020
2121Arguments:
2222 ID [required]
2323
2424Options:
25- --age INTEGER RANGE [default: 20]
26- --score FLOAT RANGE [default: 0]
27- --help Show this message and exit.
25+ --age <int range> [default: 20; x>=18 ]
26+ --score <float range> [default: 0; x<=100 ]
27+ --help Show this message and exit.
2828
2929// Pass all the CLI parameters
3030$ python main.py 5 --age 20 --score 90
You can’t perform that action at this time.
0 commit comments