[Tarantool-patches] [PATCH] box/console: Handle empty output format

Cyrill Gorcunov gorcunov at gmail.com
Thu Dec 19 21:36:04 MSK 2019


In case if output format is not specified
we should exit with more readable error
message.

Fixes #4638

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
issue: https://github.com/tarantool/tarantool/issues/4638
branch: gorcunov/gh-4638-set-output-empty

 src/box/lua/console.lua | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua
index d4d8ec984..141da8754 100644
--- a/src/box/lua/console.lua
+++ b/src/box/lua/console.lua
@@ -114,6 +114,9 @@ end
 
 local function parse_output(value)
     local fmt, opts
+    if not value then
+        return 'Specify output format: lua or yaml.'
+    end
     if value:match("([^,]+),([^,]+)") ~= nil then
         fmt, opts = value:match("([^,]+),([^,]+)")
     else
-- 
2.20.1



More information about the Tarantool-patches mailing list