Skip to content

Commit 67112fd

Browse files
committed
update example readme
1 parent 370982e commit 67112fd

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

examples/catch-all/README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ args:
2727
- name: message
2828
required: true
2929
help: Message
30+
31+
flags:
32+
- long: --debug
33+
short: -d
3034
```
3135
3236
@@ -37,7 +41,7 @@ args:
3741

3842
```shell
3943
missing required argument: MESSAGE
40-
usage: download MESSAGE [...]
44+
usage: download MESSAGE [OPTIONS] [...]
4145
4246
4347
```
@@ -48,7 +52,7 @@ usage: download MESSAGE [...]
4852
download - Catch All Example
4953
5054
Usage:
51-
download MESSAGE [...]
55+
download MESSAGE [OPTIONS] [...]
5256
download --help | -h
5357
download --version | -v
5458
@@ -59,6 +63,9 @@ Options:
5963
--version, -v
6064
Show version number
6165
66+
--debug, -d
67+
68+
6269
Arguments:
6370
MESSAGE
6471
Message
@@ -95,5 +102,25 @@ other_args:
95102
96103
```
97104

105+
### `$ ./download something --debug -- also pass --debug to catch_all`
106+
107+
```shell
108+
# this file is located in 'src/root_command.sh'
109+
# you can edit it freely and regenerate (it will not be overwritten)
110+
args:
111+
- ${args[--debug]} = 1
112+
- ${args[message]} = something
113+
114+
other_args:
115+
- ${other_args[*]} = also pass --debug to catch_all
116+
- ${other_args[0]} = also
117+
- ${other_args[1]} = pass
118+
- ${other_args[2]} = --debug
119+
- ${other_args[3]} = to
120+
- ${other_args[4]} = catch_all
121+
122+
123+
```
124+
98125

99126

0 commit comments

Comments
 (0)