Null

Description

This flag tells dasel to output null instead of ValueNotFound errors.

Usage

Pass the -n, --null flag to select commands.

Example

With the flag:
1
$ echo '[1]' | dasel -p json -n '.[1]'
2
null
Copied!
Without the flag:
1
$ echo '[1]' | dasel -p json '.[1]'
2
Error: could not query node: could not find value: no value found for selector: .[1]: [1]
3
Usage:
4
dasel select -f <file> -p <json,yaml> -s <selector> [flags]
5
​
6
Flags:
7
-f, --file string The file to query.
8
-h, --help help for select
9
-m, --multiple Select multiple results.
10
-n, --null Output null instead of value not found errors.
11
-p, --parser string Shorthand for -r FORMAT -w FORMAT.
12
--plain Alias of -w plain
13
-r, --read string The parser to use when reading.
14
-s, --selector string The selector to use when querying the data structure.
15
-w, --write string The parser to use when writing.
16
​
17
Error: could not write custom output: could not query node: could not find value: no value found for selector: .[1]: [1]
18
exit status 1
Copied!
Last modified 6mo ago
Copy link