Skip to content

Commit 477e717

Browse files
committed
Add CLI usage docs
1 parent 6b17f6a commit 477e717

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# 'sphinx_js',
1818
'myst_parser',
1919
'sphinx_copybutton',
20+
'sphinx_design',
2021
]
2122

2223
templates_path = ['_templates']
@@ -45,4 +46,5 @@
4546

4647
myst_enable_extensions = [
4748
"attrs_inline",
49+
"colon_fence",
4850
]

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ sphinx
22
myst_parser
33
sphinx-book-theme
44
sphinx-copybutton
5+
sphinx-design

docs/user_guide/command-line.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,97 @@
11
# Using the command line
2+
3+
The BIDS Validator may be run with the [Deno] runtime.
4+
For detailed installation instructions, see [Deno - Installation][].
5+
Deno is also available as a [conda-forge package](https://anaconda.org/conda-forge/deno).
6+
7+
## Installation
8+
9+
In general, there is no need to install Deno applications.
10+
`deno run` allows running from the Javascript Repository:
11+
12+
```sh
13+
deno run -ERN jsr:@bids/validator <dataset>
14+
```
15+
16+
However, you can also install a lightweight script (into `$HOME/.deno/bin`):
17+
18+
```sh
19+
deno install -ERN -g -n bids-validator jsr:@bids/validator
20+
```
21+
22+
Or compile a bundled binary:
23+
24+
```sh
25+
deno compile -ERN -o bids-validator jsr:@bids/validator
26+
```
27+
28+
## Usage
29+
30+
The BIDS Validator takes a single dataset as input:
31+
32+
::::{tab-set}
33+
:sync-group: run-method
34+
35+
:::{tab-item} Deno run
36+
:sync: run
37+
38+
```sh
39+
deno run -ERN jsr:@bids/validator <dataset>
40+
```
41+
42+
:::
43+
:::{tab-item} Installed
44+
:sync: install
45+
46+
```sh
47+
bids-validator <dataset>
48+
```
49+
50+
:::
51+
::::
52+
53+
### Options
54+
55+
| Option | Description |
56+
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
57+
| `-v`, `--verbose` | Log more extensive information about issues |
58+
| `-s URL`, `--schema URL` | Specify an alternative [BIDS Schema] for validation |
59+
| `-c FILE`, `--config FILE` | Provide a [configuration file](#configuration-file) |
60+
| `-r`, `--recursive` | Validate datasets found in `derivatives/` subdirectories, recursively |
61+
| `-o FILE`, `--outfile FILE` | Write validation results to file. |
62+
| `--json` | Output results in machine-readable [JSON] |
63+
| `--ignoreWarnings` | Do not report warnings |
64+
| `--ignoreNiftiHeaders` | Do not open NIfTI files, skipping any checks that rely on NIfTI header data |
65+
| `--filenameMode` | Perform filename checks only on newline-separated filenames read from [stdin] |
66+
| `--blacklistModalities MOD...` | Raise error if passed modalities are detected in the dataset. Modalities may be any of `mri`, `eeg`, `ieeg`, `meg`, `beh`, `pet`, `micr`, `motion`, `nirs`, or `mrs`. |
67+
| `--debug LEVEL` | Enable logging at the specified level. Default level is `ERROR`. Levels include (from most to least verbose): `NOTSET`, `DEBUG`, `INFO`, WARN`, `ERROR`, `CRITICAL`. |
68+
| `--color`, `--no-color` | Enable/disable color. The validator also respects the [NO_COLOR] and [FORCE_COLOR] environment variables. |
69+
70+
## Configuration file
71+
72+
The schema validator accepts a JSON configuration file that reclassifies issues as
73+
warnings, errors or ignored.
74+
75+
```json
76+
{
77+
"ignore": [
78+
{ "code": "JSON_KEY_RECOMMENDED", "location": "/T1w.json" }
79+
],
80+
"warning": [],
81+
"error": [
82+
{ "code": "NO_AUTHORS" }
83+
]
84+
}
85+
```
86+
87+
The issues are partial matches of the [Issues] that the validator accumulates.
88+
Pass the `--json` flag to see the issues in detail.
89+
90+
[Deno]: https://deno.com/
91+
[Deno - Installation]: https://docs.deno.com/runtime/getting_started/installation/
92+
[JSON]: https://www.json.org/json-en.html
93+
[BIDS Schema]: https://bidsschematools.readthedocs.io
94+
[stdin]: https://en.wikipedia.org/wiki/Standard_streams
95+
[NO_COLOR]: https://no-color.org
96+
[FORCE_COLOR]: https://force-color.org
97+
[Issues]: https://jsr.io/@bids/validator/doc/issues/~/Issue

0 commit comments

Comments
 (0)