diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2013-12-19 16:06:14 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-01-10 16:40:39 -0200 |
commit | cd0054de7731adc208cceb314b1b10cbbed470de (patch) | |
tree | 668b204b8940d58c3ca7e001a0d7774a7b60fdeb | |
parent | 64e386ed2c988910451079eb5879a2221976a644 (diff) | |
download | luarocks-cd0054de7731adc208cceb314b1b10cbbed470de.tar.gz luarocks-cd0054de7731adc208cceb314b1b10cbbed470de.tar.bz2 luarocks-cd0054de7731adc208cceb314b1b10cbbed470de.zip |
Remove spurious commented code
-rw-r--r-- | src/luarocks/doc.lua | 48 |
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") | |||
9 | local dir = require("luarocks.dir") | 9 | local dir = require("luarocks.dir") |
10 | local fetch = require("luarocks.fetch") | 10 | local fetch = require("luarocks.fetch") |
11 | local fs = require("luarocks.fs") | 11 | local fs = require("luarocks.fs") |
12 | --[[ | 12 | |
13 | local search = require("luarocks.search") | ||
14 | local cfg = require("luarocks.cfg") | ||
15 | local deps = require("luarocks.deps") | ||
16 | local manif = require("luarocks.manif") | ||
17 | ]] | ||
18 | help_summary = "Shows documentation for an installed rock." | 13 | help_summary = "Shows documentation for an installed rock." |
19 | 14 | ||
20 | help = [[ | 15 | help = [[ |
@@ -28,47 +23,6 @@ With these flags, return only the desired information: | |||
28 | For more information about a rock, see the 'show' command. | 23 | For more information about a rock, see the 'show' command. |
29 | ]] | 24 | ]] |
30 | 25 | ||
31 | --[[ | ||
32 | local function keys_as_string(t, sep) | ||
33 | return table.concat(util.keys(t), sep or " ") | ||
34 | end | ||
35 | |||
36 | local 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 | ||
49 | end | ||
50 | |||
51 | local 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$", "")) | ||
58 | end | ||
59 | |||
60 | local 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) | ||
69 | end | ||
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. |