Skip to content

Commit 840d6f2

Browse files
author
Florian Heinze
committed
TASK: improved README
1 parent 2e9dc3e commit 840d6f2

1 file changed

Lines changed: 40 additions & 7 deletions

File tree

README.md

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,52 @@ The script is only picked up by the helper if `DEV_SCRIPT_MARKER` is present in
5252
### Writing tasks
5353

5454
```bash
55-
# Sometask to help with something
56-
#
57-
# The first line of the comment block will be used in the task overview.
58-
# If you want to provide more details just add more lines ;)
5955
function sometask() {
6056
echo "TODO: implement sometask()"
6157
}
6258
```
63-
6459
**Tasks starting with `_` are expected to be private and will be ignored**
6560

6661
**You should not use UPPERCASE tasks in your `dev.sh`**
6762

63+
### Passing arguments
64+
65+
You can run a task providing additional arguments that will be passed to your dev.sh
66+
transparently.
67+
68+
The only exception are the `-h` and `--help` flags that are handled by the DevScriptRunner.
69+
You should not use them in your `dev.sh` script.
70+
71+
```bash
72+
dev sometask arg1 arg2 agr3
73+
```
74+
75+
```bash
76+
function sometask() {
77+
echo "$@" # -> "arg1 arg2 agr3"
78+
echo "$1" # -> "arg1"
79+
echo "$2" # -> "arg2"
80+
echo "$3" # -> "arg3"
81+
}
82+
```
83+
84+
`$@` can be pretty useful for passing all arguments to other tasks in your `dev.sh`.
85+
86+
`$@` should always be present at the end of our your `dev.sh` script.
87+
6888
### Documenting Tasks
6989

90+
```bash
91+
# Short description in first line
92+
#
93+
# Some more comments giving a detailed description about your task.
94+
# Your description can span multiple lines. There MUST not be any
95+
# empty lines for the comments to be associated with your task.
96+
function sometask() {
97+
echo "TODO: implement"
98+
}
99+
```
100+
70101
This currently is WIP and will be improved in the future ;)
71102

72103
## Usage
@@ -75,5 +106,7 @@ run `dev` for more information.
75106

76107
## TODOs
77108

78-
* Testing
79-
* more features for documenting tasks -> e.g. support examples, params, ...
109+
* more testing
110+
* dev script parsing
111+
* e2e tests actually testing the CLI
112+
* more features for documenting tasks -> e.g. support usage, examples, params, ...

0 commit comments

Comments
 (0)