From a4ac8691ab392886cc43835040b93bbd023a42da Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Fri, 17 Jan 2020 23:44:22 -0500 Subject: 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. --- src/luarocks/admin/cmd/make_manifest.lua | 1 - src/luarocks/admin/cmd/refresh_cache.lua | 1 - src/luarocks/cmd.lua | 9 ++++----- src/luarocks/cmd/new_version.lua | 2 -- src/luarocks/cmd/write_rockspec.lua | 2 -- 5 files changed, 4 insertions(+), 11 deletions(-) (limited to 'src') 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") function make_manifest.add_to_parser(parser) local cmd = parser:command("make_manifest", "Compile a manifest file for a repository.", util.see_also()) - parser:command("make-manifest"):hidden(true):action(function(args) args.command = "make_manifest" end) cmd:argument("repository", "Local repository pathname.") :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") function refresh_cache.add_to_parser(parser) local cmd = parser:command("refresh_cache", "Refresh local cache of a remote rocks server.", util.see_also()) - parser:command("refresh-cache"):hidden(true):action(function(args) args.command = "refresh_cache" end) cmd:option("--from", "The server to use. If not given, the default server ".. "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: "rockspecs of in-development versions.") parser:option("--server", "Fetch rocks/rockspecs from this server ".. "(takes priority over config file).") + :hidden_name("--from") parser:option("--only-server", "Fetch rocks/rockspecs from this server only ".. "(overrides any entries in the config file).") :argname("") + :hidden_name("--only-from") parser:option("--only-sources", "Restrict downloads to paths matching the given URL.") :argname("") + :hidden_name("--only-sources-from") parser:option("--namespace", "Specify the rocks server namespace to use.") :convert(string.lower) parser:option("--lua-dir", "Which Lua installation to use.") @@ -416,6 +419,7 @@ Enabling completion for Fish: parser:option("--lua-version", "Which Lua version to use.") :argname("") parser:option("--tree", "Which tree to operate on.") + :hidden_name("--to") parser:flag("--local", "Use the tree in the user's home directory.\n".. "To enable it, see '"..program.." help path'.") parser:flag("--global", "Use the system tree when `local_by_default` is `true`.") @@ -428,11 +432,6 @@ Enabling completion for Fish: -- Used internally to force the use of a particular project tree parser:option("--project-tree"):hidden(true) - -- Compatibility for old names of some options - parser:option("--to"):target("tree"):hidden(true) - parser:option("--from"):target("server"):hidden(true) - parser:option("--only-from"):target("only_server"):hidden(true) - parser:option("--only-sources-from"):target("only_sources"):hidden(true) for _, module in util.sortedpairs(cmd_modules) do 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 if it already exists.]], util.see_also()) :summary("Auto-write a rockspec for a new version of a rock.") - parser:command("new-version"):hidden(true):action(function(args) args.command = "new_version" end) - cmd:argument("rock", "Package name or rockspec.") :args("?") 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 rockspec, and is not guaranteed to be complete or correct. ]], util.see_also()) :summary("Write a template for a rockspec file.") - parser:command("write-rockspec"):hidden(true):action(function(args) args.command = "write_rockspec" end) - cmd:argument("name", "Name of the rock.") :args("?") cmd:argument("version", "Rock version.") -- cgit v1.2.3-55-g6feb