diff options
Diffstat (limited to 'src/luarocks/command_line.lua')
-rw-r--r-- | src/luarocks/command_line.lua | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua index 02793c5a..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 |
@@ -79,16 +85,22 @@ function run_command(...) | |||
79 | end | 85 | end |
80 | end | 86 | end |
81 | command = command:gsub("-", "_") | 87 | command = command:gsub("-", "_") |
88 | |||
89 | if flags["extensions"] then | ||
90 | cfg.use_extensions = true | ||
91 | local type_check = require("luarocks.type_check") | ||
92 | type_check.load_extensions() | ||
93 | end | ||
82 | 94 | ||
83 | if cfg.local_by_default then | 95 | if cfg.local_by_default then |
84 | flags["local"] = true | 96 | flags["local"] = true |
85 | end | 97 | end |
86 | 98 | ||
87 | if flags["to"] then | 99 | if flags["tree"] then |
88 | if flags["to"] == true then | 100 | if flags["tree"] == true then |
89 | die("Argument error: use --to=<path>") | 101 | die("Argument error: use --tree=<path>") |
90 | end | 102 | end |
91 | local root_dir = fs.absolute_name(flags["to"]) | 103 | local root_dir = fs.absolute_name(flags["tree"]) |
92 | path.use_tree(root_dir) | 104 | path.use_tree(root_dir) |
93 | elseif flags["local"] then | 105 | elseif flags["local"] then |
94 | path.use_tree(cfg.home_tree) | 106 | path.use_tree(cfg.home_tree) |
@@ -110,19 +122,23 @@ function run_command(...) | |||
110 | cfg.variables.ROCKS_TREE = cfg.rocks_dir | 122 | cfg.variables.ROCKS_TREE = cfg.rocks_dir |
111 | cfg.variables.SCRIPTS_DIR = cfg.deploy_bin_dir | 123 | cfg.variables.SCRIPTS_DIR = cfg.deploy_bin_dir |
112 | 124 | ||
113 | if flags["from"] then | 125 | if flags["server"] then |
114 | if flags["from"] == true then | 126 | if flags["server"] == true then |
115 | die("Argument error: use --from=<url>") | 127 | die("Argument error: use --server=<url>") |
116 | end | 128 | end |
117 | local protocol, path = dir.split_url(flags["from"]) | 129 | local protocol, path = dir.split_url(flags["server"]) |
118 | table.insert(cfg.rocks_servers, 1, protocol.."://"..path) | 130 | table.insert(cfg.rocks_servers, 1, protocol.."://"..path) |
119 | end | 131 | end |
120 | 132 | ||
121 | if flags["only-from"] then | 133 | if flags["only-server"] then |
122 | if flags["only-from"] == true then | 134 | if flags["only-server"] == true then |
123 | die("Argument error: use --only-from=<url>") | 135 | die("Argument error: use --only-server=<url>") |
124 | end | 136 | end |
125 | cfg.rocks_servers = { flags["only-from"] } | 137 | cfg.rocks_servers = { flags["only-server"] } |
138 | end | ||
139 | |||
140 | if flags["only-sources"] then | ||
141 | cfg.only_sources_from = flags["only-sources"] | ||
126 | end | 142 | end |
127 | 143 | ||
128 | if command ~= "help" then | 144 | if command ~= "help" then |