Skip to content

Commit

Permalink
Update help text examples to show rich-formatted output
Browse files Browse the repository at this point in the history
๐Ÿค– Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
  • Loading branch information
brentyi committed Feb 27, 2025
1 parent 5c90d1c commit b35a4b0
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions docs/source/your_first_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ $ python script.py --a 5 --b 7
12
$ python script.py --help
usage: script.py [-h] --a A [--b B]
usage: script.py [-h] --a INT [--b INT]
Add two numbers together.
options:
-h, --help show this help message and exit
--a A First number to add.
--b B Second number to add. Defaults to 3. (default: 3)
โ•ญโ”€ options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ -h, --help show this help message and exit โ”‚
โ”‚ --a INT First number to add. (required) โ”‚
โ”‚ --b INT Second number to add. Defaults to 3. (default: 3) โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
```

A more succinct version that combines the function call with printing:
Expand Down Expand Up @@ -115,14 +116,15 @@ $ python script.py --a 5
8
$ python script.py --help
usage: script.py [-h] --a A [--b B]
usage: script.py [-h] --a INT [--b INT]
Configuration for adding two numbers.
options:
-h, --help show this help message and exit
--a A First number to add
--b B Second number to add (default: 3) (default: 3)
โ•ญโ”€ options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ -h, --help show this help message and exit โ”‚
โ”‚ --a INT First number to add (required) โ”‚
โ”‚ --b INT Second number to add (default: 3) (default: 3) โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
```

## Benefits over argparse
Expand Down

0 comments on commit b35a4b0

Please # to comment.