Tarantool development patches archive
 help / color / mirror / Atom feed
From: Ilya Markov <imarkov@tarantool.org>
To: georgy@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] [PATCH] tarantoolctl: Add new options for rocks
Date: Thu, 21 Jun 2018 13:07:22 +0300	[thread overview]
Message-ID: <1529575642-27137-1-git-send-email-imarkov@tarantool.org> (raw)

Add propagation to luarocks of --only-server, --server keys.

Closes #2640
---
https://github.com/tarantool/tarantool/issues/2640
https://github.com/tarantool/tarantool/tree/gh-2640-tarantoolctl-support-only-server

 extra/dist/tarantoolctl.in | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in
index b6b8e09..3b96058 100755
--- a/extra/dist/tarantoolctl.in
+++ b/extra/dist/tarantoolctl.in
@@ -859,11 +859,28 @@ local function play()
     remote:close()
 end

+local function find_arg(name_arg)
+    for i, key in ipairs(arg) do
+        if key:find(name_arg) ~= nil then
+            return key
+        end
+    end
+    return nil
+end
+
 local function rocks()
     local cfg = require("luarocks.cfg")
     local util = require("luarocks.util")
     local loader = require("luarocks.loader")
     local command_line = require("luarocks.command_line")
+    local options = keyword_arguments
+    local key = nil
+    if options["only-server"] ~= nil then
+        key = find_arg("only%-server")
+    else
+        key = find_arg("server")
+    end
+    table.insert(positional_arguments, key)

     -- Tweak help messages
     util.see_help = function(command, program)
@@ -885,7 +902,6 @@ local function rocks()
     if keyword_arguments.chdir then
         ffi.C.chdir(keyword_arguments.chdir)
     end
-
     -- Call LuaRocks
     command_line.run_command(unpack(positional_arguments))
 end
@@ -1253,6 +1269,8 @@ do
         { 'format',      'string'  },
         { 'replica',     'number+' },
         { 'chdir',       'string'  },
+        { 'only-server', 'string'  },
+        { 'server',      'string'  },
     })

     local cmd_name
--
2.7.4

                 reply	other threads:[~2018-06-21 10:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1529575642-27137-1-git-send-email-imarkov@tarantool.org \
    --to=imarkov@tarantool.org \
    --cc=georgy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH] tarantoolctl: Add new options for rocks' \
    /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