Skip to content

API to get all cake arguments #3054

Answered by augustoproiete
junjiequ asked this question in Q&A
Discussion options

You must be logged in to vote

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.

var args = System.Environment.GetCommandLineArgs();

foreach (var arg in args)
{
    Information("{0}", arg);
}

// ...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@junjiequ
Comment options

Answer selected by junjiequ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants