private static async Task Main()

in tools/Elastic.CommonSchema.Generator/Program.cs [15:52]


	private static async Task Main(string[] args)
	{
		var token = args.Length > 0 ? args[0] : string.Empty;

		Console.WriteLine($"Running from: {Directory.GetCurrentDirectory()}");
		Console.WriteLine($"Resolved codebase root to: {CodeConfiguration.Root}");
		Console.WriteLine();

		var redownloadCoreSpecification = true;
		var downloadBranch = DefaultDownloadBranch;

		var answer = "invalid";
		while (answer != "y" && answer != "n" && answer != "")
		{
			Console.Write("Download online specifications? [Y/N] (default N): ");
			answer = Console.ReadLine()?.Trim().ToLowerInvariant();
			redownloadCoreSpecification = answer == "y";
		}

		Console.Write($"Tag to use (default {downloadBranch}): ");
		var readBranch = Console.ReadLine()?.Trim();
		if (!string.IsNullOrEmpty(readBranch)) downloadBranch = readBranch;

		if (string.IsNullOrEmpty(downloadBranch))
			downloadBranch = DefaultDownloadBranch;

		if (redownloadCoreSpecification)
			await SpecificationDownloader.DownloadAsync(downloadBranch, token);


		var ecsSchema = new EcsSchemaParser(downloadBranch).Parse();
		WarnAboutSchemaValidations(ecsSchema);

		var projection = new TypeProjector(ecsSchema).CreateProjection();
		WarnAboutProjectionValidations(projection);

		FileGenerator.Generate(projection);
	}