rmarshal is a document remarshaller.
<syntax> ::= "--help" | "--version" | <pipeline>
<pipeline> ::= <unit> | <pipeline> <whitespace> <unit>
<unit> ::= <path>
| <format> <opt_format_modifiers> <whitespace> <path>
| <document>
| <command>
<format> ::= "--plain"
| "--json"
| "--lua"
| "--toml"
| "--yaml"
<opt_format_modifiers> ::= ""
| <whitespace> "--dots" <opt_format_modifiers>
| <whitespace> "--eol" <opt_format_modifiers>
| <whitespace> "--fix" <opt_format_modifiers>
| <whitespace> "--pretty" <opt_format_modifiers>
| <whitespace> "--stream" <opt_stream_limit> <opt_format_modifiers>
<opt_stream_limit> ::= ""
| "=" <integer>
<document> ::= "--document" <whitespace> <document_hint_long> <whitespace> <text>
| "-D" <whitespace> <document_hint_long> <whitespace> <text>
| "-D" <document_hint_short> <opt_whitespace> <text>
<document_hint_long> ::= "any"
| "nil"
| "boolean"
| "integer"
| "float"
| "string"
| "json"
| "lua"
<document_hint_short> ::= "_" | "N" | "B" | "I" | "F" | "S" | "J" | "L"
<command> ::= "--check"
| "--concat"
| "--copy"
| "--merge" <merge_modifiers>
| "--pack"
| "--unpack"
| "--render" <whitespace> <path>
| "--transform" <whitespace> <path>
<merge_modifiers> ::= ""
| <whitespace> "--depth" <whitespace> <signed_integer> <merge_modifiers>
<path> ::= <character> | <character> <path>
<text> ::= <character> | <character> <text>
<character> ::= <letter> | <digit> | <symbol>
<signed_integer> ::= "-" <integer> | <integer>
<integer> ::= <digit> | <integer> <digit>
<opt_whitespace> ::= "" | <whitespace>
<whitespace> ::= " " | <whitespace> " "
Creates an array-based document by concatenating multiple array-based documents.
rmarshal INPUT... --concat OUTPUT
Merges multiple documents into one.
rmarshal INPUT... --merge [--depth DEPTH] OUTPUT
The depth is meant for array and object values. It indicates the merging depth.
For example: - a depth of value 0 will always applied the second operand. - a depth of value 1 will merge only the first level of an array or a object value.
No depth option or a negative value indicates an infinite depth.
The engine recognizes certain tags in the provided template and converts them based on the following rules:
<% Lua code. %>
<%= Lua expression -- replaced with result. %>
<%# Comment -- not rendered. %>
% A line of Lua code -- treated as <% line %>
%% replaced with % if first thing on a line and % processing is used
<%% or %%> -- replaced with <% or %> respectively.
Any leading whitespace are removed if the directive starts with <%-
.
Any trailing whitespace are removed if the directive ends with -%>
.
rmarshal sample.json --copy out.yaml
rmarshal sample.yaml --copy --json --pretty --eol out.json
rmarshal in1.json in2.toml in3.yaml --merge out.json
rmarshal sample.json --transform script.lua out.json
rmarshal sample.json --render report out.txt