aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/cmd.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua
index 9639fd7d..53e0c60a 100644
--- a/src/luarocks/cmd.lua
+++ b/src/luarocks/cmd.lua
@@ -327,12 +327,7 @@ function cmd.run_command(description, commands, ...)
327 end 327 end
328 328
329 local command 329 local command
330 if flags["version"] then 330 if flags["help"] or #nonflags == 0 then
331 util.printout(program.." "..cfg.program_version)
332 util.printout(description)
333 util.printout()
334 os.exit(cmd.errorcodes.OK)
335 elseif flags["help"] or #nonflags == 0 then
336 command = "help" 331 command = "help"
337 else 332 else
338 command = table.remove(nonflags, 1) 333 command = table.remove(nonflags, 1)
@@ -362,6 +357,13 @@ function cmd.run_command(description, commands, ...)
362 357
363 fs.init() 358 fs.init()
364 359
360 if flags["version"] then
361 util.printout(program.." "..cfg.program_version)
362 util.printout(description)
363 util.printout()
364 os.exit(cmd.errorcodes.OK)
365 end
366
365 if flags["verbose"] then 367 if flags["verbose"] then
366 cfg.verbose = true 368 cfg.verbose = true
367 fs.verbose() 369 fs.verbose()