-for a in files do
- var mp = mb.identify_file(a)
- tc.check_errors
- if mp != null and not opt_paths.value then
- var mm = mb.load_module(mp.filepath)
- if mm != null and opt_depends.value then
- mb.build_module_importation(mm)
+if sum == 0 then
+ # If one of the file is a group, default is `opt_tree` instead of `opt_package`
+ for a in files do
+ var g = mb.identify_group(a)
+ if g != null then
+ opt_tree.value = true
+ opt_package.value = false
+ break
+ end
+ end
+end
+
+var mmodules = mb.scan_full(files)
+
+# Load modules to get more informations
+for mmodule in mmodules do
+ if not opt_paths.value or opt_depends.value then
+ var ast = mmodule.parse(mb)
+ if ast != null and opt_depends.value then
+ mb.build_module_importation(ast)