372 | 372 |
-- * 'NAME' explicitly give the base module package name
|
373 | 373 |
--
|
374 | 374 |
|
375 | |
if args.package == '.' then
|
376 | |
args.package = source_dir
|
377 | |
elseif args.package == '..' then
|
378 | |
args.package = path.splitpath(source_dir)
|
379 | |
elseif not args.package:find '[\//]' then
|
380 | |
local subdir,dir = path.splitpath(source_dir)
|
381 | |
if dir == args.package then
|
382 | |
args.package = subdir
|
383 | |
elseif path.isdir(path.join(source_dir,args.package)) then
|
|
375 |
local function setup_package_base()
|
|
376 |
if ldoc.package then args.package = ldoc.package end
|
|
377 |
if args.package == '.' then
|
384 | 378 |
args.package = source_dir
|
385 | |
else
|
386 | |
quit("args.package is not the name of the source directory")
|
|
379 |
elseif args.package == '..' then
|
|
380 |
args.package = path.splitpath(source_dir)
|
|
381 |
elseif not args.package:find '[\//]' then
|
|
382 |
local subdir,dir = path.splitpath(source_dir)
|
|
383 |
if dir == args.package then
|
|
384 |
args.package = subdir
|
|
385 |
elseif path.isdir(path.join(source_dir,args.package)) then
|
|
386 |
args.package = source_dir
|
|
387 |
else
|
|
388 |
quit("args.package is not the name of the source directory")
|
|
389 |
end
|
387 | 390 |
end
|
388 | 391 |
end
|
389 | 392 |
|
|
416 | 419 |
if #config_files > 0 and not config_dir then
|
417 | 420 |
config_dir = read_ldoc_config(config_files[1])
|
418 | 421 |
end
|
|
422 |
setup_package_base()
|
419 | 423 |
|
420 | 424 |
for f in files:iter() do
|
421 | 425 |
local ext = path.extension(f)
|
|
440 | 444 |
read_ldoc_config(config)
|
441 | 445 |
end
|
442 | 446 |
end
|
|
447 |
setup_package_base()
|
443 | 448 |
local ext = path.extension(args.file)
|
444 | 449 |
local ftype = file_types[ext]
|
445 | 450 |
if not ftype then quit "unsupported extension" end
|