Files
git-tfs/GitTfs/Commands/Helpers.cs
2012-02-01 07:27:49 -05:00

34 lines
829 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using NDesk.Options;
namespace Sep.Git.Tfs.Commands
{
public static class Helpers
{
public static OptionSet Merge(this OptionSet options, params OptionSet[] others)
{
var merged = new MergableOptionSet();
merged.Merge(options);
foreach(var other in others)
merged.Merge(other);
return merged;
}
class MergableOptionSet : OptionSet
{
public void Merge(OptionSet other)
{
foreach(var option in other)
{
if(!Contains(GetKeyForItem(option)))
{
Add(option);
}
}
}
}
}
}