From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D67474696C3 for ; Mon, 20 Jan 2020 21:00:17 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id w1so50765ljh.5 for ; Mon, 20 Jan 2020 10:00:17 -0800 (PST) From: Cyrill Gorcunov Date: Mon, 20 Jan 2020 20:59:49 +0300 Message-Id: <20200120175950.28060-3-gorcunov@gmail.com> In-Reply-To: <20200120175950.28060-1-gorcunov@gmail.com> References: <20200120175950.28060-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v3 2/3] box/console: handle empty output format List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- 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 a4a36c625..17e2c91b2 100644 --- a/src/box/lua/console.lua +++ b/src/box/lua/console.lua @@ -126,6 +126,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