From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp31.i.mail.ru (smtp31.i.mail.ru [94.100.177.91]) (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 4A80A440F3C for ; Tue, 12 Nov 2019 23:35:37 +0300 (MSK) References: <686ed898-91d1-546e-6120-ed7b1f46e1d7@tarantool.org> <20191112174047.tirafxzpyiytkxfl@tkn_work_nb> From: Vladislav Shpilevoy Message-ID: <03c537b9-b903-6cec-4f52-e313f3486754@tarantool.org> Date: Tue, 12 Nov 2019 21:41:45 +0100 MIME-Version: 1.0 In-Reply-To: <20191112174047.tirafxzpyiytkxfl@tkn_work_nb> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH] app/argparse: expect no value for a boolean option List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Turenko Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the fixes! LGTM. >>> + -- Don't consume a value after a 'boolean' or >>> + -- 'boolean+' argument. >>> + if lookup[command] ~= 'boolean' and >>> + lookup[command] ~= 'boolean+' then >> >> 2. Something is wrong with the indentation. > > Let's consider three variants of splitting long if conditions: > > | if long_cond1 or > | long_cond2 then > | <...> > | end > > | if long_cond1 or > | long_cond2 then > | <...> > | end > > | if long_cond1 or > | long_cond2 then > | <...> > | end > > As I see the first and the second variants are used across tarantool's > built-in Lua code. You are right, third one, which I personally prefer, > is not used within the project. There is no options. The first is the only standard in our code. If the second one is used somewhere, then it is incorrect, or is a third-party library with own code style. > > Maybe it is better to always wrap such conditions into a function and > assign to a variable. > > Anyway, now it is wrapped into a function. >