API to get all cake arguments #3054
-
Hi communicity I am looking for an API that could return me all the cake arguments availabe during the runtime. But I am not able to find any. Could anyone point me the direction here please? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Cake doesn't have this API at the moment but it's being considered for a future version. Would you be able to provide an example where this would be useful? One workaround for now would be to use var args = System.Environment.GetCommandLineArgs();
foreach (var arg in args)
{
Information("{0}", arg);
}
// ... |
Beta Was this translation helpful? Give feedback.
Cake doesn't have this API at the moment but it's being considered for a future version.
Would you be able to provide an example where this would be useful?
One workaround for now would be to use
Environment.GetCommandLineArgs
and parse the arguments yourself to build the lookup table you mentioned or, depending on what you need, a string search or regex search might do the trick.