From 4a4299763ece819ce306ed2903c5ac90fd7ecc11 Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Fri, 16 Aug 2019 12:52:13 -0400 Subject: Allow using - or _ in commands --- src/luarocks/admin/cmd/make_manifest.lua | 1 + src/luarocks/admin/cmd/refresh_cache.lua | 1 + src/luarocks/cmd/new_version.lua | 2 ++ src/luarocks/cmd/write_rockspec.lua | 2 ++ 4 files changed, 6 insertions(+) diff --git a/src/luarocks/admin/cmd/make_manifest.lua b/src/luarocks/admin/cmd/make_manifest.lua index b4f2ca5b..ab940f9e 100644 --- a/src/luarocks/admin/cmd/make_manifest.lua +++ b/src/luarocks/admin/cmd/make_manifest.lua @@ -13,6 +13,7 @@ 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 81959953..40c9ff09 100644 --- a/src/luarocks/admin/cmd/refresh_cache.lua +++ b/src/luarocks/admin/cmd/refresh_cache.lua @@ -8,6 +8,7 @@ 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/new_version.lua b/src/luarocks/cmd/new_version.lua index 71d763f8..1aecec95 100644 --- a/src/luarocks/cmd/new_version.lua +++ b/src/luarocks/cmd/new_version.lua @@ -40,6 +40,8 @@ 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 4ab0e534..ee825ce4 100644 --- a/src/luarocks/cmd/write_rockspec.lua +++ b/src/luarocks/cmd/write_rockspec.lua @@ -63,6 +63,8 @@ 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