diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2019-07-12 17:05:11 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-07-12 17:05:11 -0300 |
commit | 6c7dfb00fa6d097319630fcc38123c30a34d1784 (patch) | |
tree | e6474951a73248d817b48031b0881d45dd0f1ca0 /src | |
parent | fe9af86aaad5aff6ceacd9cfd2d4e9438e12c40e (diff) | |
download | luarocks-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.lua | 3 |
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. |
19 | function which_cmd.command(_, modname) | 19 | function 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." |