From 0d0c705f6b808b9ab819c19c4d8bbb5a850e9e13 Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Wed, 19 Jun 2019 23:36:29 -0400 Subject: Rewrap some lines and fix some bugs --- src/luarocks/admin/cmd/add.lua | 2 +- src/luarocks/admin/cmd/make_manifest.lua | 3 +-- src/luarocks/admin/cmd/refresh_cache.lua | 3 +-- src/luarocks/admin/cmd/remove.lua | 5 ++--- src/luarocks/cmd/build.lua | 3 +-- src/luarocks/cmd/config.lua | 23 +++++++++++------------ src/luarocks/cmd/download.lua | 7 +++---- src/luarocks/cmd/write_rockspec.lua | 1 - src/luarocks/util.lua | 2 +- 9 files changed, 21 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/luarocks/admin/cmd/add.lua b/src/luarocks/admin/cmd/add.lua index f07b9fae..75f9386d 100644 --- a/src/luarocks/admin/cmd/add.lua +++ b/src/luarocks/admin/cmd/add.lua @@ -127,7 +127,7 @@ end function add.command(args) local server, server_table = cache.get_upload_server(args.server) if not server then return nil, server_table end - return add_files_to_server(not args.no_refresh, files, server, server_table, args.index) + return add_files_to_server(not args.no_refresh, args.rock, server, server_table, args.index) end diff --git a/src/luarocks/admin/cmd/make_manifest.lua b/src/luarocks/admin/cmd/make_manifest.lua index 840501ba..8eb673f5 100644 --- a/src/luarocks/admin/cmd/make_manifest.lua +++ b/src/luarocks/admin/cmd/make_manifest.lua @@ -12,8 +12,7 @@ local fs = require("luarocks.fs") 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()) + local cmd = parser:command("make_manifest", "Compile a manifest file for a repository.", util.see_also()) :add_help("--help") cmd:argument("repository", "Local repository pathname.") diff --git a/src/luarocks/admin/cmd/refresh_cache.lua b/src/luarocks/admin/cmd/refresh_cache.lua index a5bdecb4..042a07a7 100644 --- a/src/luarocks/admin/cmd/refresh_cache.lua +++ b/src/luarocks/admin/cmd/refresh_cache.lua @@ -7,8 +7,7 @@ local util = require("luarocks.util") 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()) + local cmd = parser:command("refresh_cache", "Refresh local cache of a remote rocks server.", util.see_also()) :add_help("--help") cmd:option("--from", "The server to use. If not given, the default server ".. diff --git a/src/luarocks/admin/cmd/remove.lua b/src/luarocks/admin/cmd/remove.lua index b730ca51..74432ce9 100644 --- a/src/luarocks/admin/cmd/remove.lua +++ b/src/luarocks/admin/cmd/remove.lua @@ -12,8 +12,7 @@ local cache = require("luarocks.admin.cache") local index = require("luarocks.admin.index") function admin_remove.add_to_parser(parser) - local cmd = parser:command( - "remove", "Remove a rock or rockspec from a rocks server.", util.see_also()) + local cmd = parser:command("remove", "Remove a rock or rockspec from a rocks server.", util.see_also()) :add_help("--help") cmd:argument("rock", "A local rockspec or rock file.") @@ -82,7 +81,7 @@ end function admin_remove.command(args) local server, server_table = cache.get_upload_server(args.server) if not server then return nil, server_table end - return remove_files_from_server(not args.no_refresh, files, server, server_table) + return remove_files_from_server(not args.no_refresh, args.rock, server, server_table) end diff --git a/src/luarocks/cmd/build.lua b/src/luarocks/cmd/build.lua index ea75fa3d..09e0abc7 100644 --- a/src/luarocks/cmd/build.lua +++ b/src/luarocks/cmd/build.lua @@ -19,8 +19,7 @@ local make = require("luarocks.cmd.make") local cmd = require("luarocks.cmd") function cmd_build.add_to_parser(parser) - local cmd = parser:command("build", "Build and install a rock, compiling ".. - "its C parts if any.", util.see_also()) + local cmd = parser:command("build", "Build and install a rock, compiling its C parts if any.", util.see_also()) :summary("Build/compile a rock.") :add_help("--help") diff --git a/src/luarocks/cmd/config.lua b/src/luarocks/cmd/config.lua index 9177c50d..0af9e247 100644 --- a/src/luarocks/cmd/config.lua +++ b/src/luarocks/cmd/config.lua @@ -13,18 +13,18 @@ function config_cmd.add_to_parser(parser) local cmd = parser:command("config", [[ Query information about the LuaRocks configuration. -* When given a configuration key, it prints the value of that key - according to the currently active configuration (taking into account - all config files and any command-line flags passed) +* When given a configuration key, it prints the value of that key according to + the currently active configuration (taking into account all config files and + any command-line flags passed) Examples: luarocks config lua_interpreter luarocks config variables.LUA_INCDIR luarocks config lua_version -* When given a configuration key and a value, - it overwrites the config file (see the --scope option below to determine which) - and replaces the value of the given key with the given value. +* When given a configuration key and a value, it overwrites the config file (see + the --scope option below to determine which) and replaces the value of the + given key with the given value. * `lua_dir` is a special key as it checks for a valid Lua installation (equivalent to --lua-dir) and sets several keys at once. @@ -36,15 +36,14 @@ Query information about the LuaRocks configuration. luarocks config lua_dir /usr/local luarocks config lua_version 5.3 -* When given a configuration key and --unset, - it overwrites the config file (see the --scope option below to determine which) - and deletes that key from the file. +* When given a configuration key and --unset, it overwrites the config file (see + the --scope option below to determine which) and deletes that key from the + file. Example: luarocks config variables.OPENSSL_DIR --unset -* When given no arguments, it prints the entire currently active - configuration, resulting from reading the config files from - all scopes. +* When given no arguments, it prints the entire currently active configuration, + resulting from reading the config files from all scopes. Example: luarocks config]], util.see_also([[ https://github.com/luarocks/luarocks/wiki/Config-file-format diff --git a/src/luarocks/cmd/download.lua b/src/luarocks/cmd/download.lua index 76acc9a5..7f12a35f 100644 --- a/src/luarocks/cmd/download.lua +++ b/src/luarocks/cmd/download.lua @@ -7,8 +7,7 @@ local util = require("luarocks.util") local download = require("luarocks.download") function cmd_download.add_to_parser(parser) - local cmd = parser:command( - "download", "Download a specific rock file from a rocks server.", util.see_also()) + local cmd = parser:command("download", "Download a specific rock file from a rocks server.", util.see_also()) :add_help("--help") cmd:argument("name", "Name of the rock.") @@ -33,7 +32,7 @@ function cmd_download.command(args) local name = util.adjust_name_and_namespace(args.name, args) - if not name then name, version = "", "" end + if not name then name, args.version = "", "" end local arch @@ -45,7 +44,7 @@ function cmd_download.command(args) arch = args.arch end - local dl, err = download.download(arch, name:lower(), version, args.all) + local dl, err = download.download(arch, name:lower(), args.version, args.all) return dl and true, err end diff --git a/src/luarocks/cmd/write_rockspec.lua b/src/luarocks/cmd/write_rockspec.lua index 3895a7f8..3fdc8091 100644 --- a/src/luarocks/cmd/write_rockspec.lua +++ b/src/luarocks/cmd/write_rockspec.lua @@ -54,7 +54,6 @@ This command writes an initial version of a rockspec file, based on a name, a version, and a location (an URL or a local path). If only two arguments are given, the first one is considered the name and the second one is the location. - If only one argument is given, it must be the location. If no arguments are given, current directory is used as the location. LuaRocks will attempt to infer name and version if not given, diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 5df2df51..42523c3c 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua @@ -215,7 +215,7 @@ function util.this_program(default) return prog end -function util.deps_mode_option(parser) +function util.deps_mode_option(parser, program) local cfg = require("luarocks.core.cfg") parser:option("--deps-mode", "How to handle dependencies. Four modes are supported:\n".. -- cgit v1.2.3-55-g6feb