vardotnetParams=newDotnetBaseParams("dotnet-dependency-tool-invoker","DotNet Dependency Tool Invoker","Invokes tools declared as NuGet dependencies of a project");
dotnetParams.Parse(args);
if(string.IsNullOrEmpty(dotnetParams.Command))
{
Console.WriteLine("A command name must be provided");
return;
}
varprojectContexts=
CreateProjectContexts(dotnetParams.ProjectPath)
.Where(p=>dotnetParams.Framework==null||
dotnetParams.Framework.GetShortFolderName()
.Equals(p.TargetFramework.GetShortFolderName()));
varcommandFactory=
newProjectDependenciesCommandFactory(
dotnetParams.Framework,
dotnetParams.Config,
dotnetParams.Output,
dotnetParams.BuildBasePath,
projectContexts.First().ProjectDirectory);
foreach(varprojectContextinprojectContexts)
{
Console.WriteLine($"Invoking '{dotnetParams.Command}' for '{projectContext.TargetFramework}'.");