diff --git a/src/WireMock.Net.StandAlone/Program.cs b/src/WireMock.Net.StandAlone/Program.cs index 843bc436..37db89bf 100644 --- a/src/WireMock.Net.StandAlone/Program.cs +++ b/src/WireMock.Net.StandAlone/Program.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; using CommandLineParser.Arguments; using CommandLineParser.Exceptions; using WireMock.Server; @@ -9,11 +11,11 @@ namespace WireMock.Net.StandAlone { private class Options { - [ValueArgument(typeof(string), 'u', "Urls", Description = "URL(s) to listen on", Optional = false, AllowMultiple = true)] - public string[] Urls; + [ValueArgument(typeof(string), 'u', "Urls", Description = "URL(s) to listen on.", Optional = true, AllowMultiple = true)] + public List Urls { get; set; } - [SwitchArgument('p', "AllowPartialMapping", true, Description = "Allow Partial Mapping (default set to true)", Optional = true)] - public bool AllowPartialMapping; + [SwitchArgument('p', "AllowPartialMapping", true, Description = "Allow Partial Mapping (default set to true).", Optional = true)] + public bool AllowPartialMapping { get; set; } } static void Main(params string[] args) @@ -21,13 +23,15 @@ namespace WireMock.Net.StandAlone var options = new Options(); var parser = new CommandLineParser.CommandLineParser(); parser.ExtractArgumentAttributes(options); - parser.ParseCommandLine(args); try { parser.ParseCommandLine(args); - var server = FluentMockServer.StartWithAdminInterface(options.Urls); + if (!options.Urls.Any()) + options.Urls.Add("http://localhost:9090/"); + + var server = FluentMockServer.StartWithAdminInterface(options.Urls.ToArray()); if (options.AllowPartialMapping) server.AllowPartialMapping(); @@ -39,7 +43,7 @@ namespace WireMock.Net.StandAlone Console.WriteLine(e.Message); parser.ShowUsage(); } - + Console.WriteLine("Press any key to stop the server"); Console.ReadKey(); }