in src/PortingAssistant.Client/PortingAssistantCLI.cs [72:125]
public void HandleCommand(String[] args)
{
var TargetFrameworks = new HashSet<string> { "net5.0", "netcoreapp3.1", "netstandard2.1" };
Parser.Default.ParseArguments<AssessOptions, SchemaOptions>(args)
.WithNotParsed(HandleParseError)
.WithParsed<AssessOptions>(o =>
{
isAssess = true;
if (string.IsNullOrEmpty(o.SolutionPath) || !File.Exists(o.SolutionPath) || !o.SolutionPath.EndsWith(".sln"))
{
Console.WriteLine("Invalid command, please provide valid solution path");
Environment.Exit(-1);
}
SolutionPath = o.SolutionPath;
if (string.IsNullOrEmpty(o.OutputPath) || !Directory.Exists(o.OutputPath))
{
Console.WriteLine("Invalid output path " + OutputPath);
Environment.Exit(-1);
}
OutputPath = o.OutputPath;
if (!TargetFrameworks.Contains(o.Target.ToLower()))
{
Console.WriteLine("Invalid targetFramework " + OutputPath);
Environment.Exit(-1);
}
Target = o.Target;
Tag = o.Tag;
Profile = o.Profile;
if (o.IgnoreProjects != null)
{
IgnoreProjects = o.IgnoreProjects.ToList();
}
if (o.PortingProjects != null)
{
PortingProjects = o.PortingProjects.ToList();
}
})
.WithParsed<SchemaOptions>(o =>
{
isSchema = true;
if (o.SchemaVersion)
{
schemaVersion = o.SchemaVersion;
}
}); ;
}