Skip to content

Commit 8f483c0

Browse files
Fixes watchProcessNames not set from the config file. Closes #1009 (#1010)
1 parent c360f8f commit 8f483c0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

dev-proxy/CommandHandlers/ProxyCommandHandler.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ private void ParseOptions(InvocationContext context)
110110
{
111111
Configuration.Record = record.Value;
112112
}
113-
var watchPids = context.ParseResult.GetValueForOption<IEnumerable<int>?>(ProxyHost.WatchPidsOptionName, _options);
114-
if (watchPids is not null)
113+
var watchPids = context.ParseResult.GetValueForOption<IEnumerable<int>>(ProxyHost.WatchPidsOptionName, _options);
114+
if (watchPids is not null && watchPids.Any())
115115
{
116116
Configuration.WatchPids = watchPids;
117117
}
118-
var watchProcessNames = context.ParseResult.GetValueForOption<IEnumerable<string>?>(ProxyHost.WatchProcessNamesOptionName, _options);
119-
if (watchProcessNames is not null)
118+
var watchProcessNames = context.ParseResult.GetValueForOption<IEnumerable<string>>(ProxyHost.WatchProcessNamesOptionName, _options);
119+
if (watchProcessNames is not null && watchProcessNames.Any())
120120
{
121121
Configuration.WatchProcessNames = watchProcessNames;
122122
}

dev-proxy/ProxyHost.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ internal class ProxyHost
2222
internal static readonly string RecordOptionName = "--record";
2323
private readonly Option<bool?> _recordOption;
2424
internal static readonly string WatchPidsOptionName = "--watch-pids";
25-
private readonly Option<IEnumerable<int>?> _watchPidsOption;
25+
private readonly Option<IEnumerable<int>> _watchPidsOption;
2626
internal static readonly string WatchProcessNamesOptionName = "--watch-process-names";
27-
private readonly Option<IEnumerable<string>?> _watchProcessNamesOption;
27+
private readonly Option<IEnumerable<string>> _watchProcessNamesOption;
2828
internal static readonly string ConfigFileOptionName = "--config-file";
2929
private static Option<string?>? _configFileOption;
3030
internal static readonly string NoFirstRunOptionName = "--no-first-run";
@@ -216,13 +216,13 @@ public ProxyHost()
216216

217217
_recordOption = new Option<bool?>(RecordOptionName, "Use this option to record all request logs");
218218

219-
_watchPidsOption = new Option<IEnumerable<int>?>(WatchPidsOptionName, "The IDs of processes to watch for requests")
219+
_watchPidsOption = new Option<IEnumerable<int>>(WatchPidsOptionName, "The IDs of processes to watch for requests")
220220
{
221221
ArgumentHelpName = "pids",
222222
AllowMultipleArgumentsPerToken = true
223223
};
224224

225-
_watchProcessNamesOption = new Option<IEnumerable<string>?>(WatchProcessNamesOptionName, "The names of processes to watch for requests")
225+
_watchProcessNamesOption = new Option<IEnumerable<string>>(WatchProcessNamesOptionName, "The names of processes to watch for requests")
226226
{
227227
ArgumentHelpName = "processNames",
228228
AllowMultipleArgumentsPerToken = true

0 commit comments

Comments
 (0)