From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (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 D74DE4696C3 for ; Wed, 15 Jan 2020 11:56:33 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id u71so17582431lje.11 for ; Wed, 15 Jan 2020 00:56:33 -0800 (PST) From: Cyrill Gorcunov Date: Wed, 15 Jan 2020 11:56:04 +0300 Message-Id: <20200115085605.32307-3-gorcunov@gmail.com> In-Reply-To: <20200115085605.32307-1-gorcunov@gmail.com> References: <20200115085605.32307-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 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