Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] tarantoolctl: Add new options for rocks
@ 2018-06-21 10:07 Ilya Markov
  0 siblings, 0 replies; only message in thread
From: Ilya Markov @ 2018-06-21 10:07 UTC (permalink / raw)
  To: georgy; +Cc: tarantool-patches

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-21 10:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-21 10:07 [tarantool-patches] [PATCH] tarantoolctl: Add new options for rocks Ilya Markov

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