[Tarantool-patches] [PATCH] app/argparse: expect no value for a boolean option

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue Nov 12 23:41:45 MSK 2019


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.
> 


More information about the Tarantool-patches mailing list