Summary
Gets all arguments with the specific name, evaluates and returns the
provided defaultValues if the argument is missing.
Syntax
[CakeMethodAlias]
public static ICollection<T> Arguments<T>(this ICakeContext context, string name, Func<ICakeContext, ICollection<T>> defaultValues)
Examples
// Cake.exe .\argument.cake --foo="foo" --foo="bar"
var arguments = Arguments<string>("foo", ctx => new [] { "default" });
Information("Arguments: {0}", string.Join(", ", arguments));
Attributes
Type Parameters
Name |
Description |
T |
The argument type. |
Parameters
Name |
Type |
Description |
context |
ICakeContext |
The context. |
name |
string |
The argument name. |
defaultValues |
Func<ICakeContext, ICollection<T>> |
The values to return if the argument is missing. |
Return Value
Type |
Description |
ICollection<T> |
The argument values. |