aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/admin/cmd/make_manifest.tl (renamed from src/luarocks/admin/cmd/make_manifest.lua)13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/luarocks/admin/cmd/make_manifest.lua b/src/luarocks/admin/cmd/make_manifest.tl
index 18f74b5d..8f6efd3c 100644
--- a/src/luarocks/admin/cmd/make_manifest.lua
+++ b/src/luarocks/admin/cmd/make_manifest.tl
@@ -1,7 +1,8 @@
1 1
2--- Module implementing the luarocks-admin "make_manifest" command. 2--- Module implementing the luarocks-admin "make_manifest" command.
3-- Compile a manifest file for a repository. 3-- Compile a manifest file for a repository.
4local make_manifest = {} 4local record make_manifest
5end
5 6
6local writer = require("luarocks.manif.writer") 7local writer = require("luarocks.manif.writer")
7local index = require("luarocks.admin.index") 8local index = require("luarocks.admin.index")
@@ -11,7 +12,11 @@ local deps = require("luarocks.deps")
11local fs = require("luarocks.fs") 12local fs = require("luarocks.fs")
12local dir = require("luarocks.dir") 13local dir = require("luarocks.dir")
13 14
14function make_manifest.add_to_parser(parser) 15local type Parser = require("luarocks.vendor.argparse").Parser
16
17local type Args = require("luarocks.core.types.args").Args
18
19function make_manifest.add_to_parser(parser: Parser)
15 local cmd = parser:command("make_manifest", "Compile a manifest file for a repository.", util.see_also()) 20 local cmd = parser:command("make_manifest", "Compile a manifest file for a repository.", util.see_also())
16 21
17 cmd:argument("repository", "Local repository pathname.") 22 cmd:argument("repository", "Local repository pathname.")
@@ -19,13 +24,13 @@ function make_manifest.add_to_parser(parser)
19 24
20 cmd:flag("--local-tree", "If given, do not write versioned versions of the manifest file.\n".. 25 cmd:flag("--local-tree", "If given, do not write versioned versions of the manifest file.\n"..
21 "Use this when rebuilding the manifest of a local rocks tree.") 26 "Use this when rebuilding the manifest of a local rocks tree.")
22 util.deps_mode_option(cmd) 27 util.deps_mode_option(cmd as Parser)
23end 28end
24 29
25--- Driver function for "make_manifest" command. 30--- Driver function for "make_manifest" command.
26-- @return boolean or (nil, string): True if manifest was generated, 31-- @return boolean or (nil, string): True if manifest was generated,
27-- or nil and an error message. 32-- or nil and an error message.
28function make_manifest.command(args) 33function make_manifest.command(args: Args): boolean, string
29 local repo = args.repository or cfg.rocks_dir 34 local repo = args.repository or cfg.rocks_dir
30 35
31 util.printout("Making manifest for "..repo) 36 util.printout("Making manifest for "..repo)