ArgumentExtensions.

ArgumentOrEnvironmentVariable<T>(ICakeContext, string, T, bool, string) Method

Summary

Get an Argument, EnvironmentVariable, or Default Value resolved in that order It will also add the argument to GlobalArguments

Syntax

public static T ArgumentOrEnvironmentVariable<T>(this ICakeContext context, string name, T defaultValue, bool isPrivate = false, string prefix = null)

Attributes

Type Description
CakeMethodAliasAttribute

Type Parameters

Name Description
T The type of value expected

Parameters

Name Type Description
context ICakeContext The Cake Context
name string The name of the argument or environment variable
defaultValue T The default value
isPrivate bool If set to true the argument value will be considered private and not shown when logging
prefix string Optional prefix on the environment variable

Return Value

Type Description
T The Value