ArgumentOrEnvironmentVariableAlias.

ArgumentOrEnvironmentVariable(ICakeContext, string, bool) Method

Summary

Get a bool variable from various script inputs: first via Argument, then falling back on EnvironmentVariable, finally falling back on a default.

Syntax

public static bool ArgumentOrEnvironmentVariable(this ICakeContext context, string name, bool defaultValue)

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute

Parameters

Name Type Description
context ICakeContext Cake context
name string The argument name to attempt to find in either the command line parameters or environment variables.
defaultValue bool The default value

Return Value

Type Description
bool Value found or default, first checked in command-line argument, then environment variable.