dotnet-installer/src/dotnet/commands/dotnet-complete/ParseCommand.cs

34 lines
842 B
C#
Raw Normal View History

2017-03-09 10:53:17 -08:00
using System;
using System.Linq;
using Microsoft.DotNet.Cli.CommandLine;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Cli
{
public class ParseCommand
{
public static int Run(string[] args)
{
DebugHelper.HandleDebugSwitch(ref args);
var result =
2017-03-09 10:53:17 -08:00
Parser.Instance.Parse(
args.Single());
Console.WriteLine(result.Diagram());
if (result.Errors.Any())
{
Console.WriteLine();
Console.WriteLine("ERRORS");
Console.WriteLine();
foreach (var error in result.Errors)
{
Console.WriteLine($"[{error?.Option?.Name ?? "???"}] {error.Message}");
}
}
2017-03-09 10:53:17 -08:00
return 0;
}
}
}