ArgumentAliases.

Arguments(ICakeContext) Method

Summary

Retrieves all command line arguments.
Namespace
Cake.Common
Containing Type
ArgumentAliases

Syntax

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

Examples

 var args = context.Arguments();

 if (args.ContainsKey("verbose"))
 {
     Information("Verbose output enabled");
 }

 foreach(var arg in args)
 {
     Information(
         "Key: {0}\tValue: \"{1}\"",
         arg.Key,
         string.Join(";", arg.Value)
         );
 }

Attributes

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

Parameters

Name Type Description
context ICakeContext The context.

Return Value

Type Description
IDictionary<string, ICollection<string>> The command line arguments.