This file contains hidden or 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
> docker pull microsoft/dotnet:2.0-sdk | |
# tag pulled image for easier usage | |
> docker tag microsoft/dotnet:2.0-sdk sdk2 |
This file contains hidden or 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
<?xml version="1.0"?> | |
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | |
<id>NMoneys.Serialization.Json_NET</id> | |
<title>NMoneys Serialization: Json.NET</title> | |
<version>4.0.0.0</version> | |
<authors>Daniel González García</authors> | |
<licenseUrl>http://www.opensource.org/licenses/bsd-license.php</licenseUrl> | |
<requireLicenseAcceptance>false</requireLicenseAcceptance> | |
<description>Custom serialization when NMoneys objects are to be serialized/deserialized using Json.NET.</description> |
This file contains hidden or 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
static void Main(string[] args) | |
{ | |
var parser = new Parser<Doer>(); | |
parser.Register.EmptyHelpHandler(Console.WriteLine); | |
parser.Register.HelpHandler("?,h,help", Console.WriteLine); | |
parser.Register.ErrorHandler(ex => | |
{ | |
ex.ReThrow = false; | |
Console.ForegroundColor = ConsoleColor.Red; | |
Console.WriteLine(ex.Exception.Message); |
This file contains hidden or 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
static void Main(string[] args) | |
{ | |
var app = new CommandLineApplication(); | |
app.HelpOption("-h | -? | --help"); | |
app.Commands.Add(new Something(app.OptionHelp.Template)); | |
CommandArgument locations = null; | |
CommandOption awesome = null; |
This file contains hidden or 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var parser = new ArgumentParser<IRunnable>(typeof(Something), typeof(SomethingElse)); | |
IRunnable runnable; | |
if (parser.TryParse(args, out runnable)) | |
{ | |
runnable.Run(); | |
} |
This file contains hidden or 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
ArgAction<Doer> action = Args.InvokeAction<Doer>(args); | |
} | |
} |
This file contains hidden or 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
static void Main(string[] args) | |
{ | |
Parser.Default.ParseArguments<Something, SomethingElse>(args).MapResult( | |
(Something something) => | |
{ | |
var options = new OptionsForSomething | |
{ | |
Location = something.Location, | |
Times = something.Times, | |
Awesome = something.Awesome |
This file contains hidden or 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
internal class CustomFactory : ICommandFactory | |
{ | |
public ICommand Create(Type commandType) | |
{ | |
// do some extremelly poor-man's service locations | |
if (commandType == typeof(Something)) | |
{ | |
return new Something(Console.Out); | |
} | |
if (commandType == typeof(SomethingElse)) |
This file contains hidden or 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
internal class UppercaseConstraint : Constraint | |
{ | |
public override bool Matches(object current) | |
{ | |
actual = current; | |
var c = (char)current; | |
return char.IsUpper(c); | |
} | |
public override void WriteDescriptionTo(MessageWriter writer) |
This file contains hidden or 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
public class ComposablePropertyConstraint : PropertyConstraint | |
{ | |
public ComposablePropertyConstraint(string name, IConstraint baseConstraint) : | |
base(name, baseConstraint) { } | |
} |