From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E4B1D46970E for ; Wed, 25 Dec 2019 18:06:40 +0300 (MSK) Date: Wed, 25 Dec 2019 18:06:39 +0300 From: Alexander Turenko Message-ID: <20191225150639.xwarrul5dkekmjft@tkn_work_nb> References: <20191219183604.23113-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191219183604.23113-1-gorcunov@gmail.com> Subject: Re: [Tarantool-patches] [PATCH] box/console: Handle empty output format List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tml I would add a test. Other then that LGTM. WBR, Alexander Turenko. > box/console: Handle empty output format Nit: we use small letter after a prefix in a commit message header. > In case if output format is not specified > we should exit with more readable error > message. Nit: hm, lines are 43 symbols long at max, while git commit allows up to 72 in a commit message body. This does not violate any rule, but I would format it with longer lines (around 72 chars, but less then 73). > > Fixes #4638 > > Signed-off-by: Cyrill Gorcunov > --- > 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 >