Skip to content

Commit

Permalink
Fix for urls command line parameter (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttu authored Feb 7, 2019
1 parent ee2e79d commit ece98b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

### [Unreleased]
* FIXED: urls command line parameter is not ignored

### [0.9.0] - 2019-01-31
* ADDED: Support for paging with page and per_page
Expand Down
11 changes: 9 additions & 2 deletions FakeServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private static CommandLineApplication BuildCommandLineApp(
CommandOptionType.SingleValue);
var optionServe = app.Option("-s|--serve <PATH>", "Static files (default wwwroot)",
CommandOptionType.SingleValue);
app.Option("--urls <URLS>", "Server url (default http://localhost:57602)", CommandOptionType.SingleValue);
var optionsUrls = app.Option("--urls <URLS>", "Server url (default http://localhost:57602)", CommandOptionType.SingleValue);

app.OnExecute(() =>
{
Expand Down Expand Up @@ -107,6 +107,13 @@ private static CommandLineApplication BuildCommandLineApp(
Console.WriteLine($"Static files: default wwwroot");
}

if (optionsUrls.HasValue())
{
// Add urls back to arguments that are passed to WebHost builder
app.RemainingArguments.Add("--urls");
app.RemainingArguments.Add(optionsUrls.Value());
}

return invoke(app.RemainingArguments.ToArray(), initialData);
});

Expand All @@ -118,4 +125,4 @@ private static string GetAssemblyVersion()
return FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion;
}
}
}
}

0 comments on commit ece98b3

Please sign in to comment.