forked from dotnet/command-line-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
25 lines (18 loc) · 761 Bytes
/
Program.cs
File metadata and controls
25 lines (18 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Threading.Tasks;
namespace WaitAndFailTestApp;
public class Program
{
private static TimeSpan defaultWait = TimeSpan.FromMilliseconds(3000);
//we should not be able to receive any suggestion from this test app,
//so we are not constructing it using CliConfiguration
static async Task Main(string[] args)
{
var waitPeriod = args.Length > 0 && int.TryParse(args[0], out var millisecondsToWaitParsed)
? TimeSpan.FromMilliseconds(millisecondsToWaitParsed)
: defaultWait;
await Task.Delay(waitPeriod);
Environment.ExitCode = 1;
Console.WriteLine("this 'suggestion' is provided too late and/or with invalid app exit code");
}
}