aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2013-12-19 16:06:14 -0200
committerHisham Muhammad <hisham@gobolinux.org>2014-01-10 16:40:39 -0200
commitcd0054de7731adc208cceb314b1b10cbbed470de (patch)
tree668b204b8940d58c3ca7e001a0d7774a7b60fdeb
parent64e386ed2c988910451079eb5879a2221976a644 (diff)
downloadluarocks-cd0054de7731adc208cceb314b1b10cbbed470de.tar.gz
luarocks-cd0054de7731adc208cceb314b1b10cbbed470de.tar.bz2
luarocks-cd0054de7731adc208cceb314b1b10cbbed470de.zip
Remove spurious commented code
-rw-r--r--src/luarocks/doc.lua48
1 files changed, 1 insertions, 47 deletions
diff --git a/src/luarocks/doc.lua b/src/luarocks/doc.lua
index 9fb9d688..dc51709f 100644
--- a/src/luarocks/doc.lua
+++ b/src/luarocks/doc.lua
@@ -9,12 +9,7 @@ local path = require("luarocks.path")
9local dir = require("luarocks.dir") 9local dir = require("luarocks.dir")
10local fetch = require("luarocks.fetch") 10local fetch = require("luarocks.fetch")
11local fs = require("luarocks.fs") 11local fs = require("luarocks.fs")
12--[[ 12
13local search = require("luarocks.search")
14local cfg = require("luarocks.cfg")
15local deps = require("luarocks.deps")
16local manif = require("luarocks.manif")
17]]
18help_summary = "Shows documentation for an installed rock." 13help_summary = "Shows documentation for an installed rock."
19 14
20help = [[ 15help = [[
@@ -28,47 +23,6 @@ With these flags, return only the desired information:
28For more information about a rock, see the 'show' command. 23For more information about a rock, see the 'show' command.
29]] 24]]
30 25
31--[[
32local function keys_as_string(t, sep)
33 return table.concat(util.keys(t), sep or " ")
34end
35
36local function word_wrap(line)
37 local width = tonumber(os.getenv("COLUMNS")) or 80
38 if width > 80 then width = 80 end
39 if #line > width then
40 local brk = width
41 while brk > 0 and line:sub(brk, brk) ~= " " do
42 brk = brk - 1
43 end
44 if brk > 0 then
45 return line:sub(1, brk-1) .. "\n" .. word_wrap(line:sub(brk+1))
46 end
47 end
48 return line
49end
50
51local function format_text(text)
52 text = text:gsub("^%s*",""):gsub("%s$", ""):gsub("\n[ \t]+","\n"):gsub("([^\n])\n([^\n])","%1 %2")
53 local paragraphs = util.split_string(text, "\n\n")
54 for n, line in ipairs(paragraphs) do
55 paragraphs[n] = word_wrap(line)
56 end
57 return (table.concat(paragraphs, "\n\n"):gsub("%s$", ""))
58end
59
60local function module_name(mod, filename, name, version, repo, manifest)
61 local base_dir
62 if filename:match("%.lua$") then
63 base_dir = path.deploy_lua_dir(repo)
64 else
65 base_dir = path.deploy_lib_dir(repo)
66 end
67
68 return dir.path(base_dir, filename)
69end
70]]
71
72--- Driver function for "doc" command. 26--- Driver function for "doc" command.
73-- @param name or nil: an existing package name. 27-- @param name or nil: an existing package name.
74-- @param version string or nil: a version may also be passed. 28-- @param version string or nil: a version may also be passed.