|
|
@ -33,13 +33,15 @@ See the online DFHack documentation for more examples and details.
|
|
|
|
|
|
|
|
|
|
|
|
function print_help() print(help_text) end
|
|
|
|
function print_help() print(help_text) end
|
|
|
|
|
|
|
|
|
|
|
|
valid_phases = utils.invert{
|
|
|
|
local valid_phase_list = {
|
|
|
|
'dig',
|
|
|
|
'dig',
|
|
|
|
'build',
|
|
|
|
'build',
|
|
|
|
'place',
|
|
|
|
'place',
|
|
|
|
'query',
|
|
|
|
'query',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
valid_phases = utils.invert(valid_phase_list)
|
|
|
|
|
|
|
|
|
|
|
|
local function parse_cursor(opts, arg)
|
|
|
|
local function parse_cursor(opts, arg)
|
|
|
|
local _, _, x, y, z = arg:find('^(%d+),(%d+),(%d+)$')
|
|
|
|
local _, _, x, y, z = arg:find('^(%d+),(%d+),(%d+)$')
|
|
|
|
if not x then
|
|
|
|
if not x then
|
|
|
@ -73,10 +75,12 @@ local function parse_positionals(opts, args, start_argidx)
|
|
|
|
local auto_phase = true
|
|
|
|
local auto_phase = true
|
|
|
|
local phase = args[argidx]
|
|
|
|
local phase = args[argidx]
|
|
|
|
while phase do
|
|
|
|
while phase do
|
|
|
|
if valid_phases[phase] then
|
|
|
|
if not valid_phases[phase] then
|
|
|
|
auto_phase = false
|
|
|
|
qerror(('unknown phase: "%s"; expected one of: %s'):
|
|
|
|
opts[phase] = true
|
|
|
|
format(phase, table.concat(valid_phase_list, ', ')))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
auto_phase = false
|
|
|
|
|
|
|
|
opts[phase] = true
|
|
|
|
argidx = argidx + 1
|
|
|
|
argidx = argidx + 1
|
|
|
|
phase = args[argidx]
|
|
|
|
phase = args[argidx]
|
|
|
|
end
|
|
|
|
end
|
|
|
|