[Tarantool-patches] [PATCH] box/console: Handle empty output format

Alexander Turenko alexander.turenko at tarantool.org
Wed Dec 25 18:06:39 MSK 2019


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 <gorcunov at gmail.com>
> ---
> 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
> 


More information about the Tarantool-patches mailing list