diff options
author | Paul Ouellette <oue.paul18@gmail.com> | 2020-01-17 23:44:22 -0500 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2020-01-23 12:04:40 -0300 |
commit | a4ac8691ab392886cc43835040b93bbd023a42da (patch) | |
tree | 2add754058b65f10d1cff0aa1032d53f47ba8b42 | |
parent | e58c4195c5a827cc9a53587364edfd04e9b316c4 (diff) | |
download | luarocks-a4ac8691ab392886cc43835040b93bbd023a42da.tar.gz luarocks-a4ac8691ab392886cc43835040b93bbd023a42da.tar.bz2 luarocks-a4ac8691ab392886cc43835040b93bbd023a42da.zip |
Remove hack intended to make dashed commands work
It didn't work and is no longer necessary.
Also simplifies the addition of some hidden aliases for old option
names.
-rw-r--r-- | src/luarocks/admin/cmd/make_manifest.lua | 1 | ||||
-rw-r--r-- | src/luarocks/admin/cmd/refresh_cache.lua | 1 | ||||
-rw-r--r-- | src/luarocks/cmd.lua | 9 | ||||
-rw-r--r-- | src/luarocks/cmd/new_version.lua | 2 | ||||
-rw-r--r-- | src/luarocks/cmd/write_rockspec.lua | 2 |
5 files changed, 4 insertions, 11 deletions
diff --git a/src/luarocks/admin/cmd/make_manifest.lua b/src/luarocks/admin/cmd/make_manifest.lua index ab940f9e..b4f2ca5b 100644 --- a/src/luarocks/admin/cmd/make_manifest.lua +++ b/src/luarocks/admin/cmd/make_manifest.lua | |||
@@ -13,7 +13,6 @@ local dir = require("luarocks.dir") | |||
13 | 13 | ||
14 | function make_manifest.add_to_parser(parser) | 14 | function make_manifest.add_to_parser(parser) |
15 | local cmd = parser:command("make_manifest", "Compile a manifest file for a repository.", util.see_also()) | 15 | local cmd = parser:command("make_manifest", "Compile a manifest file for a repository.", util.see_also()) |
16 | parser:command("make-manifest"):hidden(true):action(function(args) args.command = "make_manifest" end) | ||
17 | 16 | ||
18 | cmd:argument("repository", "Local repository pathname.") | 17 | cmd:argument("repository", "Local repository pathname.") |
19 | :args("?") | 18 | :args("?") |
diff --git a/src/luarocks/admin/cmd/refresh_cache.lua b/src/luarocks/admin/cmd/refresh_cache.lua index 40c9ff09..81959953 100644 --- a/src/luarocks/admin/cmd/refresh_cache.lua +++ b/src/luarocks/admin/cmd/refresh_cache.lua | |||
@@ -8,7 +8,6 @@ local cache = require("luarocks.admin.cache") | |||
8 | 8 | ||
9 | function refresh_cache.add_to_parser(parser) | 9 | function refresh_cache.add_to_parser(parser) |
10 | local cmd = parser:command("refresh_cache", "Refresh local cache of a remote rocks server.", util.see_also()) | 10 | local cmd = parser:command("refresh_cache", "Refresh local cache of a remote rocks server.", util.see_also()) |
11 | parser:command("refresh-cache"):hidden(true):action(function(args) args.command = "refresh_cache" end) | ||
12 | 11 | ||
13 | cmd:option("--from", "The server to use. If not given, the default server ".. | 12 | cmd:option("--from", "The server to use. If not given, the default server ".. |
14 | "set in the upload_server variable from the configuration file is used instead.") | 13 | "set in the upload_server variable from the configuration file is used instead.") |
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index 813f01ab..3130373f 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua | |||
@@ -404,11 +404,14 @@ Enabling completion for Fish: | |||
404 | "rockspecs of in-development versions.") | 404 | "rockspecs of in-development versions.") |
405 | parser:option("--server", "Fetch rocks/rockspecs from this server ".. | 405 | parser:option("--server", "Fetch rocks/rockspecs from this server ".. |
406 | "(takes priority over config file).") | 406 | "(takes priority over config file).") |
407 | :hidden_name("--from") | ||
407 | parser:option("--only-server", "Fetch rocks/rockspecs from this server only ".. | 408 | parser:option("--only-server", "Fetch rocks/rockspecs from this server only ".. |
408 | "(overrides any entries in the config file).") | 409 | "(overrides any entries in the config file).") |
409 | :argname("<server>") | 410 | :argname("<server>") |
411 | :hidden_name("--only-from") | ||
410 | parser:option("--only-sources", "Restrict downloads to paths matching the given URL.") | 412 | parser:option("--only-sources", "Restrict downloads to paths matching the given URL.") |
411 | :argname("<url>") | 413 | :argname("<url>") |
414 | :hidden_name("--only-sources-from") | ||
412 | parser:option("--namespace", "Specify the rocks server namespace to use.") | 415 | parser:option("--namespace", "Specify the rocks server namespace to use.") |
413 | :convert(string.lower) | 416 | :convert(string.lower) |
414 | parser:option("--lua-dir", "Which Lua installation to use.") | 417 | parser:option("--lua-dir", "Which Lua installation to use.") |
@@ -416,6 +419,7 @@ Enabling completion for Fish: | |||
416 | parser:option("--lua-version", "Which Lua version to use.") | 419 | parser:option("--lua-version", "Which Lua version to use.") |
417 | :argname("<ver>") | 420 | :argname("<ver>") |
418 | parser:option("--tree", "Which tree to operate on.") | 421 | parser:option("--tree", "Which tree to operate on.") |
422 | :hidden_name("--to") | ||
419 | parser:flag("--local", "Use the tree in the user's home directory.\n".. | 423 | parser:flag("--local", "Use the tree in the user's home directory.\n".. |
420 | "To enable it, see '"..program.." help path'.") | 424 | "To enable it, see '"..program.." help path'.") |
421 | parser:flag("--global", "Use the system tree when `local_by_default` is `true`.") | 425 | parser:flag("--global", "Use the system tree when `local_by_default` is `true`.") |
@@ -428,11 +432,6 @@ Enabling completion for Fish: | |||
428 | 432 | ||
429 | -- Used internally to force the use of a particular project tree | 433 | -- Used internally to force the use of a particular project tree |
430 | parser:option("--project-tree"):hidden(true) | 434 | parser:option("--project-tree"):hidden(true) |
431 | -- Compatibility for old names of some options | ||
432 | parser:option("--to"):target("tree"):hidden(true) | ||
433 | parser:option("--from"):target("server"):hidden(true) | ||
434 | parser:option("--only-from"):target("only_server"):hidden(true) | ||
435 | parser:option("--only-sources-from"):target("only_sources"):hidden(true) | ||
436 | 435 | ||
437 | for _, module in util.sortedpairs(cmd_modules) do | 436 | for _, module in util.sortedpairs(cmd_modules) do |
438 | module.add_to_parser(parser) | 437 | module.add_to_parser(parser) |
diff --git a/src/luarocks/cmd/new_version.lua b/src/luarocks/cmd/new_version.lua index 62fb08f6..ba85dc03 100644 --- a/src/luarocks/cmd/new_version.lua +++ b/src/luarocks/cmd/new_version.lua | |||
@@ -38,8 +38,6 @@ WARNING: it writes the new rockspec to the given directory, overwriting the file | |||
38 | if it already exists.]], util.see_also()) | 38 | if it already exists.]], util.see_also()) |
39 | :summary("Auto-write a rockspec for a new version of a rock.") | 39 | :summary("Auto-write a rockspec for a new version of a rock.") |
40 | 40 | ||
41 | parser:command("new-version"):hidden(true):action(function(args) args.command = "new_version" end) | ||
42 | |||
43 | cmd:argument("rock", "Package name or rockspec.") | 41 | cmd:argument("rock", "Package name or rockspec.") |
44 | :args("?") | 42 | :args("?") |
45 | cmd:argument("new_version", "New version of the rock.") | 43 | cmd:argument("new_version", "New version of the rock.") |
diff --git a/src/luarocks/cmd/write_rockspec.lua b/src/luarocks/cmd/write_rockspec.lua index 521f8fbc..5d5404e5 100644 --- a/src/luarocks/cmd/write_rockspec.lua +++ b/src/luarocks/cmd/write_rockspec.lua | |||
@@ -63,8 +63,6 @@ Note that the generated file is a _starting point_ for writing a | |||
63 | rockspec, and is not guaranteed to be complete or correct. ]], util.see_also()) | 63 | rockspec, and is not guaranteed to be complete or correct. ]], util.see_also()) |
64 | :summary("Write a template for a rockspec file.") | 64 | :summary("Write a template for a rockspec file.") |
65 | 65 | ||
66 | parser:command("write-rockspec"):hidden(true):action(function(args) args.command = "write_rockspec" end) | ||
67 | |||
68 | cmd:argument("name", "Name of the rock.") | 66 | cmd:argument("name", "Name of the rock.") |
69 | :args("?") | 67 | :args("?") |
70 | cmd:argument("version", "Rock version.") | 68 | cmd:argument("version", "Rock version.") |