Format
Description
Allows you to format dasel output according to the given template.
Usage
Pass the --format
flag to select commands.
Available in select
commands since v1.18.0
.
Functions and accessors
The root context .
is equal to the node found at the given selector.
It is recommended that you use the select
function with a selector to access values, but you can access properties in the path with .field.subField
if preferred.
Function | Description |
---|---|
| Returns the node at the given selector. |
| Returns a list of nodes found for the given selector. |
| Alias of |
| Alias of |
| Returns |
| Returns |
| Allows recursive calls to the formatting capability. Useful when using a |
| Returns a newline character. |
Dasel also provides access to sprig functions within templates to allow more functionality.
The templates are parsed using golang's text/template
package so dasel also supports an array of conditional and loop statements by default.
Description | Example |
---|---|
If condition |
|
If not condition |
|
Range |
|
Text and space manipulation |
For more information refer to the related documentation.
Example
Select
SelectMultiple
Last updated