From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id F2F34265E0 for ; Thu, 21 Jun 2018 06:07:37 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GLvlO9544Xma for ; Thu, 21 Jun 2018 06:07:37 -0400 (EDT) Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 4E79F265DC for ; Thu, 21 Jun 2018 06:07:37 -0400 (EDT) From: Ilya Markov Subject: [tarantool-patches] [PATCH] tarantoolctl: Add new options for rocks Date: Thu, 21 Jun 2018 13:07:22 +0300 Message-Id: <1529575642-27137-1-git-send-email-imarkov@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: georgy@tarantool.org Cc: tarantool-patches@freelists.org 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