aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/cmd/lint.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/cmd/lint.lua')
-rw-r--r--src/luarocks/cmd/lint.lua32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/luarocks/cmd/lint.lua b/src/luarocks/cmd/lint.lua
index c9ea45ea..433eed84 100644
--- a/src/luarocks/cmd/lint.lua
+++ b/src/luarocks/cmd/lint.lua
@@ -7,24 +7,22 @@ local util = require("luarocks.util")
7local download = require("luarocks.download") 7local download = require("luarocks.download")
8local fetch = require("luarocks.fetch") 8local fetch = require("luarocks.fetch")
9 9
10lint.help_summary = "Check syntax of a rockspec." 10function lint.add_to_parser(parser)
11lint.help_arguments = "<rockspec>" 11 local cmd = parser:command("lint", "Check syntax of a rockspec.\n\n"..
12lint.help = [[ 12 "Returns success if the text of the rockspec is syntactically correct, else failure.",
13This is a utility function that checks the syntax of a rockspec. 13 util.see_also())
14 14 :summary("Check syntax of a rockspec.")
15It returns success or failure if the text of a rockspec is 15 :add_help(false)
16syntactically correct. 16
17]] 17 cmd:argument("rockspec", "The rockspec to check.")
18 18end
19function lint.command(flags, input) 19
20 if not input then 20function lint.command(args)
21 return nil, "Argument missing. "..util.see_help("lint") 21
22 end 22 local filename = args.rockspec
23 23 if not filename:match(".rockspec$") then
24 local filename = input
25 if not input:match(".rockspec$") then
26 local err 24 local err
27 filename, err = download.download("rockspec", input:lower()) 25 filename, err = download.download("rockspec", filename:lower())
28 if not filename then 26 if not filename then
29 return nil, err 27 return nil, err
30 end 28 end