Skip to content

Commit d0e6b31

Browse files
committed
Better documentation for the options/args file
1 parent 58d199f commit d0e6b31

2 files changed

Lines changed: 34 additions & 22 deletions

File tree

docs/basic/options.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,32 @@ If the amount of options is a little overwhelming for you, you can
6565
write them down to a file and let ``byexample`` load them for you.
6666

6767
The only convention that you need to follow is to write **one** option
68-
per line.
68+
per line. If the option receives one argument you can separate them by
69+
`=` or by a space but if there is more than one argument you will have
70+
to write the option and the arguments one by one in its own line.
6971

7072
```shell
7173
$ cat test/ds/options_file
74+
# Options and their arguments are separated by a = or by a space
7275
-l python
73-
--options "+norm-ws"
76+
--options=+norm-ws
77+
<...>
78+
# But if the option receives more than one argument, all of them
79+
# must be in its own line
80+
--skip
81+
test/ds/pkg/foo1.py
82+
test/ds/pkg/foo2.py
83+
<...>
84+
# This wouldn't work:
85+
#--skip test/ds/pkg/foo1.py test/ds/pkg/foo2.py
86+
<...>
7487
```
7588

7689
Then load it with ``@`` and the file; you can use multiple files
7790
and combine them with more options from the command line:
7891

7992
```shell
80-
$ byexample @test/ds/options_file test/ds/python-tutorial.v2.md
93+
$ byexample @test/ds/options_file -- test/ds/python-tutorial.v2.md
8194
<...>
8295
File test/ds/python-tutorial.v2.md, 4/4 test ran in <...> seconds
8396
[PASS] Pass: 4 Fail: 0 Skip: 0
@@ -86,20 +99,6 @@ File test/ds/python-tutorial.v2.md, 4/4 test ran in <...> seconds
8699
> **Note:** before `10.5.2` the options in the file required to be followed by an
87100
> `=` like `-l=python`; spaces were not allowed.
88101
89-
Currently if the option receives more than one argument, you will still
90-
have to list *all* the arguments one per line.
91-
92-
```shell
93-
$ cat test/ds/pkg/bopts2
94-
--skip
95-
test/ds/pkg/foo1.py
96-
test/ds/pkg/foo2.py
97-
--
98-
test/ds/pkg/foo1.py
99-
test/ds/pkg/foo2.py
100-
test/ds/pkg/bar1.py
101-
```
102-
103102
## File pattern expansions
104103

105104
Consider the following:
@@ -152,14 +151,17 @@ test/ds/pkg/foo1.py
152151
test/ds/pkg/foo2.py
153152
<...>
154153
155-
$ byexample -l python @test/ds/pkg/bopts2 | grep pkg | sort # byexample: +timeout=8
156-
File test/ds/pkg/bar1.py, 1/1 test ran in <...> seconds
154+
$ byexample -l python @test/ds/pkg/bopts2 | grep pkg | wc -l # byexample: +timeout=8
155+
1
157156
158157
$ cat test/ds/pkg/bopts3
159158
<...>skip=test/ds/pkg/foo1.py test/ds/pkg/foo2.py
160159
<...>
161160
162-
$ byexample -l python @test/ds/pkg/bopts2 | grep pkg | sort # byexample: +timeout=8
163-
File test/ds/pkg/bar1.py, 1/1 test ran in <...> seconds
161+
$ byexample -l python @test/ds/pkg/bopts2 | grep pkg | wc -l # byexample: +timeout=8
162+
1
163+
164+
$ byexample -l python @test/ds/pkg/bopts | grep pkg | wc -l # byexample: +timeout=8
165+
1
164166
165167
-->

test/ds/options_file

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1+
# Options and their arguments are separated by a = or by a space
12
-l python
2-
--options "+norm-ws"
3+
--options=+norm-ws
4+
5+
# But if the option receives more than one argument, all of them
6+
# must be in its own line
7+
--skip
8+
test/ds/pkg/foo1.py
9+
test/ds/pkg/foo2.py
10+
11+
# This wouldn't work:
12+
#--skip test/ds/pkg/foo1.py test/ds/pkg/foo2.py

0 commit comments

Comments
 (0)