GetArguments vs GetArgument on 1.0rc0001 and rc0002 #3026
Replies: 4 comments 3 replies
-
@DTTerastar You could change the addin to use the Another option could be to invoke the method via reflection, and if it fails, call the other one. |
Beta Was this translation helpful? Give feedback.
-
What's your user case / the problem you're trying to solve? Could you use Argument(ICakeContext, string, T) which is existed for several versions on a higher level in Common? |
Beta Was this translation helpful? Give feedback.
-
@DTTerastar We would accept a PR which adds a |
Beta Was this translation helpful? Give feedback.
-
An extension method called var helloArg = Context.Arguments.GetArgument("hello");
Information("Hello arg value: {0}", helloArg); dotnet cake --hello=Augusto |
Beta Was this translation helpful? Give feedback.
-
I tested my stuff on 1.0rc0001 and rc0002 and the lack of Arguments.GetArgument is a big blocker: Error: System.AggregateException: One or more errors occurred. (Method not found: 'System.String Cake.Core.ICakeArguments.GetArgument(System.String)'.)
---> System.MissingMethodException: Method not found: 'System.String Cake.Core.ICakeArguments.GetArgument(System.String)'.
at Cake.Utils.Prompt.PromptAliases.ArgumentT
at Submission#0.ArgumentT
The fact 0.38 and 0.37 don't have a GetArguments also means I can't use start using that or else my addon will fail on that version.
Would a PR with a GetArgument being a call to GetArguments().SingleOrDefault() be met w/ happiness or disdain? It can be Obsolete from the start.
Beta Was this translation helpful? Give feedback.
All reactions