aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-11-02 08:21:39 -0200
committerHisham Muhammad <hisham@gobolinux.org>2012-11-02 08:21:39 -0200
commit8b8ff0119db3ad791d13a067fe7cfabdcc7bf329 (patch)
treea6945969d54b81326e4993eec5459e31ae0bad42
parentf011442df99e775e0fe8f28b4c84b59fcd787597 (diff)
downloadluarocks-8b8ff0119db3ad791d13a067fe7cfabdcc7bf329.tar.gz
luarocks-8b8ff0119db3ad791d13a067fe7cfabdcc7bf329.tar.bz2
luarocks-8b8ff0119db3ad791d13a067fe7cfabdcc7bf329.zip
Make --tree in 'show' command compliant with the behavior of the flag in other commands.
Rename old --tree to --rock-tree.
-rw-r--r--src/luarocks/show.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/luarocks/show.lua b/src/luarocks/show.lua
index dd84e794..7849934d 100644
--- a/src/luarocks/show.lua
+++ b/src/luarocks/show.lua
@@ -23,7 +23,7 @@ With these flags, return only the desired information:
23--deps packages this package depends on 23--deps packages this package depends on
24--rockspec the full path of the rockspec file 24--rockspec the full path of the rockspec file
25--mversion the package version 25--mversion the package version
26--tree local tree where rock is installed 26--rock-tree local tree where rock is installed
27--rock-dir data directory of the installed rock 27--rock-dir data directory of the installed rock
28]] 28]]
29 29
@@ -79,7 +79,11 @@ function run(...)
79 local query = search.make_query(name, version) 79 local query = search.make_query(name, version)
80 query.exact_name = true 80 query.exact_name = true
81 local tree_map = {} 81 local tree_map = {}
82 for _, tree in ipairs(cfg.rocks_trees) do 82 local trees = cfg.rocks_trees
83 if flags["tree"] then
84 trees = { flags["tree"] }
85 end
86 for _, tree in ipairs(trees) do
83 local rocks_dir = path.rocks_dir(tree) 87 local rocks_dir = path.rocks_dir(tree)
84 tree_map[rocks_dir] = tree 88 tree_map[rocks_dir] = tree
85 search.manifest_search(results, rocks_dir, query) 89 search.manifest_search(results, rocks_dir, query)
@@ -111,7 +115,7 @@ function run(...)
111 if not manifest then return nil,err end 115 if not manifest then return nil,err end
112 local minfo = manifest.repository[name][version][1] 116 local minfo = manifest.repository[name][version][1]
113 117
114 if flags["tree"] then util.printout(repo) 118 if flags["rock-tree"] then util.printout(repo)
115 elseif flags["rock-dir"] then util.printout(directory) 119 elseif flags["rock-dir"] then util.printout(directory)
116 elseif flags["home"] then util.printout(descript.homepage) 120 elseif flags["home"] then util.printout(descript.homepage)
117 elseif flags["modules"] then util.printout(keys_as_string(minfo.modules)) 121 elseif flags["modules"] then util.printout(keys_as_string(minfo.modules))