{"id":"systemd-directive-list","version":"1.0.0","description":"List systemd unit directives as words using syntax quoting, continuation, and resets.","supported_operations":["parse systemd unit directives","split a systemd unit setting into words","systemd unit file line continuation","read repeatable systemd directives","apply systemd syntax quoting to a unit value","empty systemd directive resets the list","list words in a systemd drop-in fragment"],"unsupported_operations":["split Environment= words into variable assignments","expand percent specifiers in a unit file","glue neighboring quoted fragments into one word"],"semantics":["A unit-file quote wraps one whole word. The opening quote is accepted only at the start of a word, and the closer must be followed by a space, a tab, or the end of the value. Text stuck to a closer is invalid_input. Quote marks are removed. This tool does not glue neighboring pieces into one word.","A physical line continues only when the logical text so far ends in an odd number of backslashes. That final backslash is replaced by one space, and the next non-comment physical line is appended with its leading spaces. Comment lines in between are skipped. An even run of trailing backslashes does not continue.","An empty value resets that key: words is empty and the effective list becomes empty. Key=\"\" is one empty word, not a reset. Repeated section names continue the same section. lists keeps first-seen key order and the words that remain after resets.","Escapes from systemd.syntax Table 1 apply in quoted and unquoted words. Unknown or truncated escapes are invalid_input. A plausible key outside [A-Za-z][A-Za-z0-9]* is unsupported_input. Specifiers are not expanded."],"limits":{"max_input_bytes":4096,"max_sections":32,"max_directives":64,"max_words":128,"max_word_bytes":512,"max_logical_line_bytes":1024,"max_physical_lines":256,"max_continuations":32,"max_section_chars":128,"max_output_bytes":65536},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","maxLength":4096,"description":"Unit fragment. Maximum 4096 UTF-8 bytes, checked in run()."}}},"output_schema":{"type":"object","additionalProperties":false,"required":["sections"],"properties":{"sections":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["name","line","directives","lists"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"line":{"type":"integer","minimum":1},"directives":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","line","reset","words"],"properties":{"key":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z][A-Za-z0-9]*$"},"line":{"type":"integer","minimum":1},"reset":{"type":"boolean"},"words":{"type":"array","items":{"type":"string"}}}}},"lists":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","words"],"properties":{"key":{"type":"string","minLength":1},"words":{"type":"array","items":{"type":"string"}}}}}}}}}},"examples":[{"input":{"text":"[Service]\nEnvironment=\"VAR1=word1 word2\" VAR2=word3 \"VAR3=$word 5 6\"\n"},"output":{"sections":[{"name":"Service","line":1,"directives":[{"key":"Environment","line":2,"reset":false,"words":["VAR1=word1 word2","VAR2=word3","VAR3=$word 5 6"]}],"lists":[{"key":"Environment","words":["VAR1=word1 word2","VAR2=word3","VAR3=$word 5 6"]}]}]}},{"input":{"text":"[Service]\nEnvironment=A=1 B=2\nEnvironment=\nEnvironment=C=3\n"},"output":{"sections":[{"name":"Service","line":1,"directives":[{"key":"Environment","line":2,"reset":false,"words":["A=1","B=2"]},{"key":"Environment","line":3,"reset":true,"words":[]},{"key":"Environment","line":4,"reset":false,"words":["C=3"]}],"lists":[{"key":"Environment","words":["C=3"]}]}]}},{"input":{"text":"[S]\nK=ab\\\ncd\n"},"output":{"sections":[{"name":"S","line":1,"directives":[{"key":"K","line":2,"reset":false,"words":["ab","cd"]}],"lists":[{"key":"K","words":["ab","cd"]}]}]}}],"execute_url":"/v1/tools/systemd-directive-list/versions/1.0.0/execute"}