Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Leonid <lvasiliev@tarantool.org>, alexander.turenko@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH LUAROCKS v2 2/2] Add the tarantool options black list. Update help
Date: Wed, 18 Mar 2020 23:12:52 +0100	[thread overview]
Message-ID: <cbbc5240-cafb-41f8-24bf-82e5e024f9b8@tarantool.org> (raw)
In-Reply-To: <84f7da7c7c1ff9502e8f1e023ce2bec0aabc402f.1574153367.git.lvasiliev@tarantool.org>

Thanks for the patch!

The same comment regarding the commit description as
for the previous commit.

Also see 3 comments below.

On 19/11/2019 09:52, Leonid wrote:
> ---
>  src/luarocks/cmd/help.lua | 15 +++++++++------
>  src/luarocks/util.lua     | 14 ++++++++++++++
>  2 files changed, 23 insertions(+), 6 deletions(-)
> 
> diff --git a/src/luarocks/cmd/help.lua b/src/luarocks/cmd/help.lua
> index dcc9e35..1db914a 100644
> --- a/src/luarocks/cmd/help.lua
> +++ b/src/luarocks/cmd/help.lua
> @@ -20,7 +24,11 @@ help.help = [[
>  ]]
>  
>  local function print_banner()
> -   util.printout("\nLuaRocks "..cfg.program_version..", the Lua package manager")
> +   if program:find("tarantoolctl") then
> +      util.printout("\nTarantoolctl rocks, the Lua package manager based on LuaRocks "..cfg.program_version)
> +   else
> +      util.printout("\nLuaRocks "..cfg.program_version..", the Lua package manager")
> +   end

1. These lines are huge. Please, keep them inside 80 symbols border.

>  end
>  
>  local function print_section(section)
> @@ -62,12 +70,7 @@ function help.command(description, commands, command)
>  	                       (overrides any entries in the config file)
>  	--only-sources=<url>   Restrict downloads to paths matching the
>  	                       given URL.
> -        --lua-dir=<prefix>     Which Lua installation to use.
> -	--lua-version=<ver>    Which Lua version to use.
>  	--tree=<tree>          Which tree to operate on.
> -	--local                Use the tree in the user's home directory.
> -	                       To enable it, see ']]..program..[[ help path'.
> -	--global               Use the system tree when `local_by_default` is `true`.
>  	--verbose              Display verbose output of commands executed.
>  	--timeout=<seconds>    Timeout on network operations, in seconds.
>  	                       0 means no timeout (wait forever).
> diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua
> index fadc93f..660d140 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,
> +}
> +
>  --- 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.." does not supported by tarantoolctl roks." }

2. does -> is.

The same below.

3. You seem to try to distinguish the tool for tarantoolctl
and non-tarantoolctl from what I see in help.lua. But you
check the blacklist even if the code works not from tarantoolctl.
And even print a message about tarantoolctl.Why?

> +            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.." does not supported by tarantoolctl roks." }
> +            end
>              local vartype = supported_flags[var]
>              if type(vartype) == "string" then
>                 i = i + 1
> 

  reply	other threads:[~2020-03-18 22:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19  8:52 [Tarantool-patches] [PATCH LUAROCKS v2 0/2] Move a rocks options filter from tarantoolctl to luarocks Leonid
2019-11-19  8:52 ` [Tarantool-patches] [PATCH LUAROCKS v2 1/2] Add the chdir option for make Leonid
2020-03-18 22:12   ` Vladislav Shpilevoy
2019-11-19  8:52 ` [Tarantool-patches] [PATCH LUAROCKS v2 2/2] Add the tarantool options black list. Update help Leonid
2020-03-18 22:12   ` Vladislav Shpilevoy [this message]
2020-03-18 22:12 ` [Tarantool-patches] [PATCH LUAROCKS v2 0/2] Move a rocks options filter from tarantoolctl to luarocks Vladislav Shpilevoy
2020-03-25 22:28   ` lvasiliev

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=cbbc5240-cafb-41f8-24bf-82e5e024f9b8@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=lvasiliev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH LUAROCKS v2 2/2] Add the tarantool options black list. Update help' \
    /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