in cli/src/main/kotlin/org.jetbrains.intellij/StructureGenerator.kt [9:16]
fun generate(projectDir: File?): Structure {
val workingDirectory = File(System.getProperty("user.dir"))
val projectDirectory = projectDir ?: workingDirectory
val project = loadProjectLikeFile(projectDirectory)
?: loadProjectLikeDirectory(projectDirectory)
?: throw IllegalArgumentException("Project not found in directory: $projectDirectory")
return Structure(project.name, project.modules)
}