diff options
| author | Paul Ouellette <oue.paul18@gmail.com> | 2019-06-19 12:30:17 -0400 |
|---|---|---|
| committer | Paul Ouellette <oue.paul18@gmail.com> | 2019-08-01 23:53:03 -0400 |
| commit | 3cf0c501f2ab62a73f25c6b244b8b019d4b1a36a (patch) | |
| tree | f6fc2687fcce222f71601c31db15dc29df71b2d3 /src | |
| parent | 0823c4dd62e15515ad1e77cd20681b720485c564 (diff) | |
| download | luarocks-3cf0c501f2ab62a73f25c6b244b8b019d4b1a36a.tar.gz luarocks-3cf0c501f2ab62a73f25c6b244b8b019d4b1a36a.tar.bz2 luarocks-3cf0c501f2ab62a73f25c6b244b8b019d4b1a36a.zip | |
Remove program_name cmd.run_command argument
Diffstat (limited to 'src')
| -rwxr-xr-x | src/bin/luarocks | 2 | ||||
| -rwxr-xr-x | src/bin/luarocks-admin | 2 | ||||
| -rw-r--r-- | src/luarocks/cmd.lua | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/luarocks b/src/bin/luarocks index 18c8fac6..56caaa60 100755 --- a/src/bin/luarocks +++ b/src/bin/luarocks | |||
| @@ -32,4 +32,4 @@ local commands = { | |||
| 32 | test = "luarocks.cmd.test", | 32 | test = "luarocks.cmd.test", |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | cmd.run_command("luarocks", description, commands, "luarocks.cmd.external", ...) | 35 | cmd.run_command(description, commands, "luarocks.cmd.external", ...) |
diff --git a/src/bin/luarocks-admin b/src/bin/luarocks-admin index db746bea..4a85e45b 100755 --- a/src/bin/luarocks-admin +++ b/src/bin/luarocks-admin | |||
| @@ -15,4 +15,4 @@ local commands = { | |||
| 15 | refresh_cache = "luarocks.admin.cmd.refresh_cache", | 15 | refresh_cache = "luarocks.admin.cmd.refresh_cache", |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | cmd.run_command("luarocks-admin", description, commands, "luarocks.admin.cmd.external", ...) | 18 | cmd.run_command(description, commands, "luarocks.admin.cmd.external", ...) |
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index 34dc75d8..1c8f0946 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua | |||
| @@ -337,7 +337,7 @@ local function get_config_text() | |||
| 337 | return buf.."\n" | 337 | return buf.."\n" |
| 338 | end | 338 | end |
| 339 | 339 | ||
| 340 | local function get_parser(program_name, description, cmd_modules) | 340 | local function get_parser(description, cmd_modules) |
| 341 | local epilog = [[ | 341 | local epilog = [[ |
| 342 | Variables: | 342 | Variables: |
| 343 | Variables from the "variables" table of the configuration file can be | 343 | Variables from the "variables" table of the configuration file can be |
| @@ -346,7 +346,7 @@ Variables: | |||
| 346 | ]]..get_config_text() | 346 | ]]..get_config_text() |
| 347 | 347 | ||
| 348 | local parser = argparse( | 348 | local parser = argparse( |
| 349 | program_name, "LuaRocks "..cfg.program_version..", the Lua package manager\n\n".. | 349 | dir.base_name(program), "LuaRocks "..cfg.program_version..", the Lua package manager\n\n".. |
| 350 | program.." - "..description, epilog) | 350 | program.." - "..description, epilog) |
| 351 | :help_max_width(80) | 351 | :help_max_width(80) |
| 352 | :add_help("--help") | 352 | :add_help("--help") |
| @@ -408,7 +408,7 @@ end | |||
| 408 | -- @param commands table: contains the loaded modules representing commands. | 408 | -- @param commands table: contains the loaded modules representing commands. |
| 409 | -- @param external_namespace string: where to look for external commands. | 409 | -- @param external_namespace string: where to look for external commands. |
| 410 | -- @param ... string: Arguments given on the command-line. | 410 | -- @param ... string: Arguments given on the command-line. |
| 411 | function cmd.run_command(program_name, description, commands, external_namespace, ...) | 411 | function cmd.run_command(description, commands, external_namespace, ...) |
| 412 | 412 | ||
| 413 | check_popen() | 413 | check_popen() |
| 414 | 414 | ||
| @@ -452,7 +452,7 @@ function cmd.run_command(program_name, description, commands, external_namespace | |||
| 452 | end | 452 | end |
| 453 | 453 | ||
| 454 | local args, cmdline_vars = process_cmdline_vars(...) | 454 | local args, cmdline_vars = process_cmdline_vars(...) |
| 455 | local parser = get_parser(program_name, description, cmd_modules) | 455 | local parser = get_parser(description, cmd_modules) |
| 456 | args = parser:parse(args) | 456 | args = parser:parse(args) |
| 457 | 457 | ||
| 458 | if not args.command then | 458 | if not args.command then |
