question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add IEnumerable<T> support for arguments

See original GitHub issue

Would be nice if we supported passing multiple arguments to the Cake.exe.

cake.exe --foo=1 --foo=2 --foo=3

And allowed the user to resolve them all by resolving an IEnumerable<T> like this:

var foo = Argument<IEnumerable<int>>("foo", Enumerable.Empty<int>());

Of course there would have to be safe guards in place to ensure that we throw if the user try to resolve a single argument where multiple has been passed and vice versa.

(Originally reported at http://stackoverflow.com/questions/35727010/how-do-i-pass-an-argument-that-is-a-string-array-to-my-cake-script)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:4
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
gitfoolcommented, Apr 13, 2016

I also thought that commandline was a good option if Cake was to improve it’s command-line support. It’s a bit confusing and inconsistent having different parameter passing done by PowerShell / Bash (in the bootstrapper) and then by Cake. It would be better if Cake did everything and the bootstrapper did nothing but bootstrap.

1reaction
fleedcommented, Jul 20, 2018

Any update on this one?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to treat an IEnumerable<T> as a params T ...
If you have an IEnumerable<T> and a method expects a T[] , just call ToArray on your enumerable. var fields = resultRecord.GetType().
Read more >
c# - Pass IEnumerable<T> as an argument of method and ...
I've seen tutorials of Unit Testing and I've never seen that IEnumerable<T> used as an argument of method. All authors use Repository pattern ......
Read more >
Enumerable.Append<TSource>(IEnumerable ...
Appends a value to the end of the sequence.
Read more >
IEnumerable<T> Interface (System.Collections.Generic)
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Read more >
How to add strings to a ienumerable<System.String> - Help
Hi, I am trying to add arguments (strings) to a Systems.Collections.Generic. ... IEnumerable is only to view the contents of a collection.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found