-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multi-instance option support (#678)
* Add multi-instance option support Fixes #357 * Fix Appveyor build It seems Appveyor's C# compiler is old enough that it doesn't know how to do tuple deconstruction, so we'll avoid doing that. It makes TokenPartitioner uglier, but no getting around that if we're dealing with an old C# compiler.
- Loading branch information
Showing
22 changed files
with
598 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using CSharpx; | ||
|
||
namespace CommandLine.Core | ||
{ | ||
static class PartitionExtensions | ||
{ | ||
public static Tuple<IEnumerable<T>,IEnumerable<T>> PartitionByPredicate<T>( | ||
this IEnumerable<T> items, | ||
Func<T, bool> pred) | ||
{ | ||
List<T> yes = new List<T>(); | ||
List<T> no = new List<T>(); | ||
foreach (T item in items) { | ||
List<T> list = pred(item) ? yes : no; | ||
list.Add(item); | ||
} | ||
return Tuple.Create<IEnumerable<T>,IEnumerable<T>>(yes, no); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.