Skip to content

Commit

Permalink
(cake-buildGH-4128) Fix Inconsistent determination of positional Argu…
Browse files Browse the repository at this point in the history
…ment when using context.Arguments versus context.Argument
  • Loading branch information
augustoproiete committed Apr 2, 2023
1 parent b764038 commit 3cc76c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Cake.Common/ArgumentAliases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static T Argument<T>(this ICakeContext context, string name)
throw new ArgumentNullException(nameof(context));
}

var value = context.Arguments.GetArguments(name).FirstOrDefault();
var value = context.Arguments.GetArguments(name).LastOrDefault();
if (value == null)
{
const string format = "Argument '{0}' was not set.";
Expand Down Expand Up @@ -248,7 +248,7 @@ public static T Argument<T>(this ICakeContext context, string name, T defaultVal
throw new ArgumentNullException(nameof(context));
}

var value = context.Arguments.GetArguments(name)?.FirstOrDefault();
var value = context.Arguments.GetArguments(name)?.LastOrDefault();
return value == null
? defaultValue
: Convert<T>(value);
Expand Down

0 comments on commit 3cc76c5

Please sign in to comment.