aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/command_line.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/command_line.lua')
-rw-r--r--src/luarocks/command_line.lua34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua
index 41c1c278..8fa9073c 100644
--- a/src/luarocks/command_line.lua
+++ b/src/luarocks/command_line.lua
@@ -57,6 +57,12 @@ function run_command(...)
57 end 57 end
58 local nonflags = { util.parse_flags(unpack(args)) } 58 local nonflags = { util.parse_flags(unpack(args)) }
59 local flags = table.remove(nonflags, 1) 59 local flags = table.remove(nonflags, 1)
60
61 if flags["from"] then flags["server"] = flags["from"] end
62 if flags["only-from"] then flags["only-server"] = flags["only-from"] end
63 if flags["only-sources-from"] then flags["only-sources"] = flags["only-sources-from"] end
64 if flags["to"] then flags["tree"] = flags["to"] end
65
60 cfg.flags = flags 66 cfg.flags = flags
61 67
62 local command 68 local command
@@ -90,11 +96,11 @@ function run_command(...)
90 flags["local"] = true 96 flags["local"] = true
91 end 97 end
92 98
93 if flags["to"] then 99 if flags["tree"] then
94 if flags["to"] == true then 100 if flags["tree"] == true then
95 die("Argument error: use --to=<path>") 101 die("Argument error: use --tree=<path>")
96 end 102 end
97 local root_dir = fs.absolute_name(flags["to"]) 103 local root_dir = fs.absolute_name(flags["tree"])
98 path.use_tree(root_dir) 104 path.use_tree(root_dir)
99 elseif flags["local"] then 105 elseif flags["local"] then
100 path.use_tree(cfg.home_tree) 106 path.use_tree(cfg.home_tree)
@@ -116,23 +122,23 @@ function run_command(...)
116 cfg.variables.ROCKS_TREE = cfg.rocks_dir 122 cfg.variables.ROCKS_TREE = cfg.rocks_dir
117 cfg.variables.SCRIPTS_DIR = cfg.deploy_bin_dir 123 cfg.variables.SCRIPTS_DIR = cfg.deploy_bin_dir
118 124
119 if flags["from"] then 125 if flags["server"] then
120 if flags["from"] == true then 126 if flags["server"] == true then
121 die("Argument error: use --from=<url>") 127 die("Argument error: use --server=<url>")
122 end 128 end
123 local protocol, path = dir.split_url(flags["from"]) 129 local protocol, path = dir.split_url(flags["server"])
124 table.insert(cfg.rocks_servers, 1, protocol.."://"..path) 130 table.insert(cfg.rocks_servers, 1, protocol.."://"..path)
125 end 131 end
126 132
127 if flags["only-from"] then 133 if flags["only-server"] then
128 if flags["only-from"] == true then 134 if flags["only-server"] == true then
129 die("Argument error: use --only-from=<url>") 135 die("Argument error: use --only-server=<url>")
130 end 136 end
131 cfg.rocks_servers = { flags["only-from"] } 137 cfg.rocks_servers = { flags["only-server"] }
132 end 138 end
133 139
134 if flags["only-sources-from"] then 140 if flags["only-sources"] then
135 cfg.only_sources_from = flags["only-sources-from"] 141 cfg.only_sources_from = flags["only-sources"]
136 end 142 end
137 143
138 if command ~= "help" then 144 if command ~= "help" then