aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2019-07-12 17:05:11 -0300
committerHisham Muhammad <hisham@gobolinux.org>2019-07-12 17:05:11 -0300
commit6c7dfb00fa6d097319630fcc38123c30a34d1784 (patch)
treee6474951a73248d817b48031b0881d45dd0f1ca0 /src
parentfe9af86aaad5aff6ceacd9cfd2d4e9438e12c40e (diff)
downloadluarocks-6c7dfb00fa6d097319630fcc38123c30a34d1784.tar.gz
luarocks-6c7dfb00fa6d097319630fcc38123c30a34d1784.tar.bz2
luarocks-6c7dfb00fa6d097319630fcc38123c30a34d1784.zip
which: report error on missing argument
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/cmd/which.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/luarocks/cmd/which.lua b/src/luarocks/cmd/which.lua
index 0116fdb8..89e6db56 100644
--- a/src/luarocks/cmd/which.lua
+++ b/src/luarocks/cmd/which.lua
@@ -17,6 +17,9 @@ that module by luarocks.loader, like "/usr/local/lua/]]..cfg.lua_version..[[/foo
17--- Driver function for "lua" command. 17--- Driver function for "lua" command.
18-- @return boolean This function terminates the interpreter. 18-- @return boolean This function terminates the interpreter.
19function which_cmd.command(_, modname) 19function which_cmd.command(_, modname)
20 if modname == nil then
21 return nil, "Missing module name. " .. util.see_help("which")
22 end
20 local pathname, rock_name, rock_version = loader.which(modname) 23 local pathname, rock_name, rock_version = loader.which(modname)
21 if not pathname then 24 if not pathname then
22 return nil, "Module '" .. modname .. "' not found by luarocks.loader." 25 return nil, "Module '" .. modname .. "' not found by luarocks.loader."