For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

addStringOption

Adds an option that will have one string value supplied as a separate argument. Calling this method behaves exactly like calling addStringOption(option, null).

addStringOption("foo") will not produce any arguments.

addStringOption("foo").setValue("bar baz") will produce the command-line

    -foo 'bar baz'

Return

an option object to further configure the value

Since

0.7

Parameters

option

command-line option


Adds an option that will have one string value supplied as a separate argument.

addStringOption("foo", "bar baz") will produce the command-line

    -foo 'bar baz'

A value of null will make the option not be supplied and can be used to unset an option that previously was set.

The returned option object can also be used to further configure the value.

addStringOption("foo", "bar baz").setValue("bam") will produce the command-line

    -foo bam

Return

an option object to further configure the value

Since

0.7

Parameters

option

command-line option

value

the value to supply or null to suppress the option