I can no longer pass empty string as argument values #3198
-
What You Are Seeing?I can no longer run cake like this with an empty string:
What is Expected?The argument in the cake string returns either null or an empty string: var prefix = Argument("prefix", "");
// prefix == "" What version of Cake are you using?1.0.0 Are you running on a 32 or 64 bit system?64 What environment are you running on? Windows? Linux? Mac?Windows and macOS Are you running on a CI Server? If so, which one?DevOps and local How Did You Get This To Happen? (Steps to Reproduce)No need for any special cake file, this is the tooling. Output Logdotnet cake --prefix=""
Error: Expected an option value.
--prefix=
^ Did you forget the option value? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
@mattleibow as said, this is a feature - or rather it's side effect of Cake 1.0.0 being able to accept flags in addition to key-value-arguments. @devlead described it in stack overflow
As to you're question in gitter:
No, that's not equivalent. var prefix = Argument<string>("prefix", ""); (Which then has the drawback that you probably will get the same value as if the argument was not set.) |
Beta Was this translation helpful? Give feedback.
-
TL;DR; in Cake v1.0, Use a
|
Beta Was this translation helpful? Give feedback.
@mattleibow as said, this is a feature - or rather it's side effect of Cake 1.0.0 being able to accept flags in addition to key-value-arguments.
@devlead described it in stack overflow
As to you're question in gitter:
No, that's not equivalent.
You'd have to supply a default in your Cake file. Like so: