{
try
{
+ if (processId < 0)
+ {
+ Console.Out.WriteLine($"The PID cannot be negative: {processId}");
+ return -1;
+ }
+
+ if (processId == 0)
+ {
+ Console.Out.WriteLine($"-p|--process-id is required");
+ return -1;
+ }
+
output = string.IsNullOrEmpty(output) ?
$"{DateTime.Now.ToString(@"yyyyMMdd\_hhmmss")}_{processId}.gcdump" :
output;
new Option(
aliases: new[] { "-p", "--process-id" },
description: "The process to collect the trace from",
- argument: new Argument<int> { Name = "pid" },
+ argument: new Argument<int>(defaultValue: 0) { Name = "pid" },
isHidden: false);
private static Option OutputPathOption() =>