diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-19 10:34:39 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-01 15:51:13 -0300 |
| commit | a1d5c8ca857d455582efefe88037b82792734b9c (patch) | |
| tree | b6acff0b405fe182313f5c76729d8fc75d72023f /src | |
| parent | a55f09fae00cb3c575f926eda4d76e81ff37b2ba (diff) | |
| download | luarocks-a1d5c8ca857d455582efefe88037b82792734b9c.tar.gz luarocks-a1d5c8ca857d455582efefe88037b82792734b9c.tar.bz2 luarocks-a1d5c8ca857d455582efefe88037b82792734b9c.zip | |
cmd: rename luarocks.command_line to luarocks.cmd
Diffstat (limited to 'src')
| -rwxr-xr-x | src/bin/luarocks | 4 | ||||
| -rwxr-xr-x | src/bin/luarocks-admin | 4 | ||||
| -rw-r--r-- | src/luarocks/cmd.lua (renamed from src/luarocks/command_line.lua) | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/bin/luarocks b/src/bin/luarocks index 583b50b8..d776445c 100755 --- a/src/bin/luarocks +++ b/src/bin/luarocks | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | local cfg = require("luarocks.core.cfg") | 4 | local cfg = require("luarocks.core.cfg") |
| 5 | 5 | ||
| 6 | local loader = require("luarocks.loader") | 6 | local loader = require("luarocks.loader") |
| 7 | local command_line = require("luarocks.command_line") | 7 | local cmd = require("luarocks.cmd") |
| 8 | 8 | ||
| 9 | program_description = "LuaRocks main command-line interface" | 9 | program_description = "LuaRocks main command-line interface" |
| 10 | 10 | ||
| @@ -33,4 +33,4 @@ commands = { | |||
| 33 | test = "luarocks.cmd.test", | 33 | test = "luarocks.cmd.test", |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | command_line.run_command(...) | 36 | cmd.run_command(...) |
diff --git a/src/bin/luarocks-admin b/src/bin/luarocks-admin index 5db24640..4521ac26 100755 --- a/src/bin/luarocks-admin +++ b/src/bin/luarocks-admin | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | local cfg = require("luarocks.core.cfg") | 4 | local cfg = require("luarocks.core.cfg") |
| 5 | 5 | ||
| 6 | local loader = require("luarocks.loader") | 6 | local loader = require("luarocks.loader") |
| 7 | local command_line = require("luarocks.command_line") | 7 | local cmd = require("luarocks.cmd") |
| 8 | 8 | ||
| 9 | program_description = "LuaRocks repository administration interface" | 9 | program_description = "LuaRocks repository administration interface" |
| 10 | 10 | ||
| @@ -16,4 +16,4 @@ commands = { | |||
| 16 | refresh_cache = "luarocks.admin.cmd.refresh_cache", | 16 | refresh_cache = "luarocks.admin.cmd.refresh_cache", |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | command_line.run_command(...) | 19 | cmd.run_command(...) |
diff --git a/src/luarocks/command_line.lua b/src/luarocks/cmd.lua index b542fb9c..3048d956 100644 --- a/src/luarocks/command_line.lua +++ b/src/luarocks/cmd.lua | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | ||
| 2 | --- Functions for command-line scripts. | 2 | --- Functions for command-line scripts. |
| 3 | local command_line = {} | 3 | local cmd = {} |
| 4 | 4 | ||
| 5 | local unpack = unpack or table.unpack | 5 | local unpack = unpack or table.unpack |
| 6 | 6 | ||
| @@ -72,7 +72,7 @@ end | |||
| 72 | -- Uses the global table "commands", which contains | 72 | -- Uses the global table "commands", which contains |
| 73 | -- the loaded modules representing commands. | 73 | -- the loaded modules representing commands. |
| 74 | -- @param ... string: Arguments given on the command-line. | 74 | -- @param ... string: Arguments given on the command-line. |
| 75 | function command_line.run_command(...) | 75 | function cmd.run_command(...) |
| 76 | local args = {...} | 76 | local args = {...} |
| 77 | local cmdline_vars = {} | 77 | local cmdline_vars = {} |
| 78 | for i = #args, 1, -1 do | 78 | for i = #args, 1, -1 do |
| @@ -239,8 +239,8 @@ function command_line.run_command(...) | |||
| 239 | end | 239 | end |
| 240 | 240 | ||
| 241 | if commands[command] then | 241 | if commands[command] then |
| 242 | local cmd = require(commands[command]) | 242 | local cmd_mod = require(commands[command]) |
| 243 | local call_ok, ok, err, exitcode = xpcall(function() return cmd.command(flags, unpack(nonflags)) end, error_handler) | 243 | local call_ok, ok, err, exitcode = xpcall(function() return cmd_mod.command(flags, unpack(nonflags)) end, error_handler) |
| 244 | if not call_ok then | 244 | if not call_ok then |
| 245 | die(ok, cfg.errorcodes.CRASH) | 245 | die(ok, cfg.errorcodes.CRASH) |
| 246 | elseif not ok then | 246 | elseif not ok then |
| @@ -252,4 +252,4 @@ function command_line.run_command(...) | |||
| 252 | util.run_scheduled_functions() | 252 | util.run_scheduled_functions() |
| 253 | end | 253 | end |
| 254 | 254 | ||
| 255 | return command_line | 255 | return cmd |
