From cf94893bbd540d2ed62642ecf0938b7954ef13c6 Mon Sep 17 00:00:00 2001 From: Hisham Date: Fri, 14 Oct 2016 17:09:38 -0700 Subject: Add labels and issues_url metadata --- src/luarocks/show.lua | 8 ++++++++ src/luarocks/type_check.lua | 5 +++++ src/luarocks/util.lua | 2 ++ 3 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/luarocks/show.lua b/src/luarocks/show.lua index 66ac6448..53d8ffa5 100644 --- a/src/luarocks/show.lua +++ b/src/luarocks/show.lua @@ -94,6 +94,8 @@ function show.command(flags, name, version) if flags["rock-tree"] then util.printout(path.rocks_tree_to_string(repo)) elseif flags["rock-dir"] then util.printout(directory) elseif flags["home"] then util.printout(descript.homepage) + elseif flags["issues"] then util.printout(descript.issues_url) + elseif flags["labels"] then util.printout(descript.labels and table.concat(descript.labels, "\n")) elseif flags["modules"] then util.printout(keys_as_string(minfo.modules, "\n")) elseif flags["deps"] then util.printout(keys_as_string(minfo.dependencies)) elseif flags["rockspec"] then util.printout(rockspec_file) @@ -112,6 +114,12 @@ function show.command(flags, name, version) if descript.homepage then util.printout("Homepage: ", descript.homepage) end + if descript.issues_url then + util.printout("Issues: ", descript.issues_url) + end + if descript.labels then + util.printout("Labels: ", table.concat(descript.labels, ", ")) + end util.printout("Installed in: ", path.rocks_tree_to_string(repo)) if next(minfo.modules) then util.printout() diff --git a/src/luarocks/type_check.lua b/src/luarocks/type_check.lua index 382d3f0a..4b7e68d7 100644 --- a/src/luarocks/type_check.lua +++ b/src/luarocks/type_check.lua @@ -9,6 +9,9 @@ type_check.rockspec_format = "3.0" local string_1 = type_check.string_1 local mandatory_string_1 = type_check.mandatory_string_1 +local string_3 = { _type = "string", _version = "3.0" } +local list_of_strings_3 = { _any = string_3, _version = "3.0" } + -- Syntax for type-checking tables: -- -- A type-checking table describes typing data for a value. @@ -33,6 +36,8 @@ local rockspec_types = { homepage = string_1, license = string_1, maintainer = string_1, + labels = list_of_strings_3, + issues_url = string_3, }, dependencies = { platforms = {}, -- recursively defined below diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 9760fafd..b23f4fab 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua @@ -87,7 +87,9 @@ local supported_flags = { ["help"] = true, ["home"] = true, ["homepage"] = "\"\"", + ["issues"] = true, ["keep"] = true, + ["labels"] = true, ["lib"] = "", ["license"] = "\"\"", ["list"] = true, -- cgit v1.2.3-55-g6feb