Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH] box/console: Handle empty output format
@ 2019-12-19 18:36 Cyrill Gorcunov
  2019-12-25 15:06 ` Alexander Turenko
  0 siblings, 1 reply; 2+ messages in thread
From: Cyrill Gorcunov @ 2019-12-19 18:36 UTC (permalink / raw)
  To: tml

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

Fixes #4638

Signed-off-by: Cyrill Gorcunov <gorcunov@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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-25 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 18:36 [Tarantool-patches] [PATCH] box/console: Handle empty output format Cyrill Gorcunov
2019-12-25 15:06 ` Alexander Turenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox