rcl evaluate¶
rcl evaluate [-f | --format <format>] [--] [<file>] [--output <outfile>]
Shorthands:
rcl eval
rcl e (uses default --format=rcl)
rcl je (sets --format=json)
rcl re (sets --format=raw)
Description¶
Read an RCL expression from the file <file>, and evaluate it. Print the evaluated result to stdout. When <file> is -, read from stdin. When no file is specified, the input defaults to stdin.
Options¶
--banner <message>¶
Prepend the banner message to the output. This can be useful to add a comment to a generated file to clarify that the file is generated. RCL implicitly adds a line break between the banner and the output.
-f --format <format>¶
Output in the given format. The following formats are supported:
- json
- json-lines
- raw
- rcl
- systemd
- toml, alias for
toml-1.0 - toml-1.0
- toml-1.1
- yaml-stream
The default output format is rcl. For the je command shorthand, the default output format is json, and for re, the output format is raw.
--output-depfile <depfile>¶
Write the names of the files that were loaded during evaluation in Makefile syntax to the file <depfile>. This can be used by build systems to re-run rcl when one of the inputs changes. See also the depfile section of the Ninja documentation. Because the depfile includes the name of the dependent file, this option can only be used in combination with --output.
-o --output <outfile>¶
Write the output to the given file instead of stdout. When --directory is set, the output path is relative to that directory. --color does not apply when using --output.
--sandbox <mode>¶
Limit which files can be imported in import expressions. Two modes are available:
- workdir
- Only allow importing files inside the working directory, including subdirectories. For example, when
rclis executed in/home/user/exprs, importing/home/user/exprs/a/b.rclis allowed, but importing/home/user/.config/private.rclis not. - unrestricted
- Grant unrestricted filesystem access, allow importing any file.
The default sandboxing mode is workdir.
-w --width <width>¶
Target line width for pretty-printing, in columns. Must be an integer. Defaults to 80. Note that the formatter is not always able to stay within the desired limit.