Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Leonid Vasiliev <lvasiliev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 2/3] Add a black list of the tarantoolctl options
Date: Sat, 4 Apr 2020 21:02:47 +0200	[thread overview]
Message-ID: <3903e055-5853-6606-7fd1-87b5a4c60662@tarantool.org> (raw)
In-Reply-To: <d8a3ab2022ec3f347df9d1df2ba870c6689a9968.1585168251.git.lvasiliev@tarantool.org>

Thanks for the patch!

See 3 comments below.

On 25/03/2020 22:50, Leonid Vasiliev wrote:
> Luarocks code style has been used

1. This message does not give any useful info. Better explain, why
did you add the list to the luarocks instead of to tarantoolctl.

> ---
>  src/luarocks/util.lua | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua
> index 8ccda27..0172d08 100644
> --- a/src/luarocks/util.lua
> +++ b/src/luarocks/util.lua
> @@ -171,6 +171,14 @@ local supported_flags = {
>     ["version"] = true,
>  }
>  
> +-- The tarantool unsupported arguments list.
> +local tarantool_black_list = {
> +   ["global"] = true,
> +   ["local"] = true,
> +   ["lua-version"] = true,
> +   ["lua-dir"] = true,

2. Why can't you just remove these flags from 'supported_flags'?
Or make them false there?

> +}
> +
>  --- Extract flags from an arguments list.
>  -- Given string arguments, extract flag arguments into a flags set.
>  -- For example, given "foo", "--tux=beep", "--bla", "bar", "--baz",
> @@ -189,6 +197,9 @@ function util.parse_flags(...)
>        elseif state == "initial" and flag then
>           local var,val = flag:match("([a-z_%-]*)=(.*)")
>           if val then
> +            if tarantool_black_list[var] then
> +               return { ERROR = "Invalid argument: flag --"..var.." is not supported by tarantoolctl roks." }

3. Probably 'rocks' instead of 'roks'? The same below.

> +            end
>              local vartype = supported_flags[var]
>              if type(vartype) == "string" then
>                 if val == "" and vartype:sub(1,1) ~= '"' then
> @@ -204,6 +215,9 @@ function util.parse_flags(...)
>              end
>           else
>              local var = flag
> +            if tarantool_black_list[var] then
> +               return { ERROR = "Invalid argument: flag --"..var.." is not supported by tarantoolctl roks." }
> +            end
>              local vartype = supported_flags[var]
>              if type(vartype) == "string" then
>                 i = i + 1
> 

  reply	other threads:[~2020-04-04 19:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 21:50 [Tarantool-patches] [PATCH 0/3] Adapt luarocks for tarantoolctl Leonid Vasiliev
2020-03-25 21:50 ` [Tarantool-patches] [PATCH 1/3] Add the chdir option for make Leonid Vasiliev
2020-04-02  9:58   ` lvasiliev
2020-04-04 19:02   ` Vladislav Shpilevoy
2020-04-05 15:03     ` lvasiliev
2020-03-25 21:50 ` [Tarantool-patches] [PATCH 2/3] Add a black list of the tarantoolctl options Leonid Vasiliev
2020-04-04 19:02   ` Vladislav Shpilevoy [this message]
2020-04-05 15:11     ` lvasiliev
2020-04-05 18:39       ` Vladislav Shpilevoy
2020-03-25 21:50 ` [Tarantool-patches] [PATCH 3/3] Adapt luarocks help for the tarantoolctl Leonid Vasiliev
2020-04-04 19:02   ` Vladislav Shpilevoy
2020-04-05 15:15     ` lvasiliev
2020-04-05 18:39       ` Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3903e055-5853-6606-7fd1-87b5a4c60662@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=lvasiliev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 2/3] Add a black list of the tarantoolctl options' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox