Can we read command line arguments in settings.gradle?

I want to read command line arguments in settings.gradle so that i can add only those submodules in include what i am passing command line.

Can we read command line arguments in settings.gradle?

You can qualify each task at command line with the project name to target tasks in specific projects.

Eg: gradlew :project1:assemble :project2:check

can i read variables defined settings.gradle into build.gradle

Got the solution finally
rootProject.name = ‘wrapper’

// Define all the sub projects
def subprojects = ['sub-module-1','sub-module-2','sub-module-3'] as Set

// Read all subprojects from the project properties.
// Example of passed in project properties with Gradle CLI with the -P option
// gradlew build -Pmodules="sub-module-1,sub-module-2" bootJar
def includedProjectsKey="modules"
def projectsToIncludeInput = hasProperty(includedProjectsKey) ? getProperties().get(includedProjectsKey) : ""
//Defining boolean variable to true add sub-module-3 sub-module if values mentioned in -Pmodules has sub-module-1 and no sub-module-3.
//This is done because sub-module-3 is added a dependency in sub-module-1/build.gradle
def addsubModule3=false

if(projectsToIncludeInput.contains('sub-module-1') && !projectsToIncludeInput.contains('sub-module-3')){
	addsubModule3=true
}

Set<String> projectsToInclude = []
if(projectsToIncludeInput != "") {
	// Include passed in sub projects from project arguments
	projectsToIncludeInput.toString().split(",").each {
	projectsToInclude.add(it)
}
projectsToInclude.add('common')

if(addsubModule3){
	projectsToInclude.add('sub-module-3')
}

}	else {

// Include all sub projects if none is specified
projectsToInclude = subprojects
}

// Include sub projects
projectsToInclude.each {
	include it
}