From 3b9ea34fb70b298364828202fe95ef0a845c0c04 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Thu, 21 Aug 2014 15:41:43 -0700 Subject: [PATCH] First hack at setting up Mono.Options --- src/Update/Program.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Update/Program.cs b/src/Update/Program.cs index 306c98f3..c4793ddf 100644 --- a/src/Update/Program.cs +++ b/src/Update/Program.cs @@ -3,13 +3,32 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Mono.Options; namespace Update { class Program { - static void Main(string[] args) + static int Main(string[] args) { + if (args.Any(x => x.StartsWith("/squirrel", StringComparison.OrdinalIgnoreCase))) { + // NB: We're marked as Squirrel-aware, but we don't want to do + // anything in response to these events + return 0; + } + + var opts = new OptionSet() { + { "h|?|help", v => ShowHelp() } + }; + + opts.Parse(args); + + return 0; + } + + static void ShowHelp() + { + Console.WriteLine("Help!"); } } }