Skip to content

Commit f71717f

Browse files
committed
fix hook example readme
1 parent 7690098 commit f71717f

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

examples/hooks/README.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,52 @@ $ bashly add hooks
1212
$ bashly generate
1313
```
1414

15-
<!-- include: src/root_command.sh -->
16-
1715
-----
16+
17+
## `bashly.yml`
18+
19+
```yaml
20+
name: hooks
21+
help: Sample application that uses before/after hooks
22+
version: 0.1.0
23+
24+
flags:
25+
- long: --debug
26+
short: -d
27+
help: Enable debug mode
28+
```
29+
30+
31+
32+
## Generated script output
33+
34+
### `$ ./hooks`
35+
36+
```shell
37+
==[ Before Hook Called ]==
38+
args: none
39+
# this file is located in 'src/root_command.sh'
40+
# you can edit it freely and regenerate (it will not be overwritten)
41+
args: none
42+
==[ After Hook Called ]==
43+
44+
45+
```
46+
47+
### `$ ./hooks --debug`
48+
49+
```shell
50+
==[ Before Hook Called ]==
51+
args:
52+
- ${args[--debug]} = 1
53+
# this file is located in 'src/root_command.sh'
54+
# you can edit it freely and regenerate (it will not be overwritten)
55+
args:
56+
- ${args[--debug]} = 1
57+
==[ After Hook Called ]==
58+
59+
60+
```
61+
62+
63+

0 commit comments

Comments
 (0)