ArgumentAliases.

Arguments<T>(ICakeContext, string, T) Method

Summary

Gets all arguments with the specific name and returns the provided defaultValue if the argument is missing.
Namespace
Cake.Common
Containing Type
ArgumentAliases

Syntax

[CakeMethodAlias]
public static ICollection<T> Arguments<T>(this ICakeContext context, string name, T defaultValue)

Examples

// Cake.exe .\argument.cake --foo="foo" --foo="bar"
var arguments = Arguments<string>("foo", "default");
Information("Arguments: {0}", string.Join(", ", arguments));

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.

Type Parameters

Name Description
T The argument type.

Parameters

Name Type Description
context ICakeContext The context.
name string The argument name.
defaultValue T The value to return if the argument is missing.

Return Value

Type Description
ICollection<T> The argument values.