From 3d9856ffb0cf49f7d6313b351f1b4d3f9da0cbde Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 20 Apr 2018 10:56:00 -0300 Subject: Add --project-tree flag, for prepending a flag --- src/luarocks/command_line.lua | 4 ++++ src/luarocks/util.lua | 1 + 2 files changed, 5 insertions(+) diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua index c8026ab6..07f86a7f 100644 --- a/src/luarocks/command_line.lua +++ b/src/luarocks/command_line.lua @@ -131,6 +131,10 @@ function command_line.run_command(...) cfg.branch = flags["branch"] end + if flags["project-tree"] then + table.insert(cfg.rocks_trees, 1, { name = "project", root = flags["project-tree"] } ) + end + if flags["tree"] then local named = false for _, tree in ipairs(cfg.rocks_trees) do diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 64765a43..ea18071f 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua @@ -129,6 +129,7 @@ local supported_flags = { ["output"] = "", ["pack-binary-rock"] = true, ["porcelain"] = true, + ["project-tree"] = "", ["quick"] = true, ["rock-dir"] = true, ["rock-namespace"] = true, -- cgit v1.2.3-55-g6feb