diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua index efd1cddd89240e5a7ba6aac0eab4f4ce190781d5..7cf8cfb686de2a6b47e9a0e9f37706ffe2f19ddc 100644 --- a/src/box/lua/console.lua +++ b/src/box/lua/console.lua @@ -177,6 +177,23 @@ local function current_eos() return output_eos[current_output()["fmt"]] end +-- +-- Set/get current console EOS value from +-- currently active output format. +local function console_eos(eos_value) + if not eos_value then + return tostring(current_eos()) + end + -- We can't allow to change yaml eos format + -- because it is a part of encoding standart. + local d = current_output() + if d["fmt"] == "yaml" then + error("console.eos(): is immutable for output " .. d["fmt"]) + else + output_eos[d["fmt"]] = eos_value + end +end + -- -- Map output format descriptor into a "\set" command. local function output_to_cmd_string(desc) @@ -805,6 +822,7 @@ package.loaded['console'] = { delimiter = delimiter; set_default_output = set_default_output; get_default_output = get_default_output; + eos = console_eos; ac = ac; connect = connect; listen = listen;