2016-11-15 15:42:15 -08:00
|
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Microsoft.DotNet.Cli.CommandLine;
|
|
|
|
|
using Microsoft.DotNet.Cli.Utils;
|
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using Microsoft.Build.Construction;
|
|
|
|
|
using Microsoft.DotNet.ProjectJsonMigration;
|
|
|
|
|
using NuGet.Frameworks;
|
2016-11-15 16:41:29 -08:00
|
|
|
|
using Microsoft.DotNet.Tools.Add.ProjectToProjectReference;
|
2016-11-15 15:42:15 -08:00
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Tools.Add
|
|
|
|
|
{
|
2016-11-29 09:44:39 -08:00
|
|
|
|
public class AddCommand : DispatchCommand
|
2016-11-15 15:42:15 -08:00
|
|
|
|
{
|
2016-12-04 23:24:07 -08:00
|
|
|
|
protected override string HelpText => $@"{LocalizableStrings.NetAddCommand}
|
2016-11-16 15:49:25 -08:00
|
|
|
|
|
2016-12-04 23:24:07 -08:00
|
|
|
|
{LocalizableStrings.Usage}: dotnet add [options] <object> <command> [[--] <arg>...]]
|
2016-11-22 14:41:56 -08:00
|
|
|
|
|
2016-12-04 23:24:07 -08:00
|
|
|
|
{LocalizableStrings.Options}:
|
|
|
|
|
-h|--help {LocalizableStrings.HelpDefinition}
|
2016-11-15 15:42:15 -08:00
|
|
|
|
|
2016-12-04 23:24:07 -08:00
|
|
|
|
{LocalizableStrings.Arguments}:
|
|
|
|
|
<object> {LocalizableStrings.ArgumentsObjectDefinition}
|
|
|
|
|
<command> {LocalizableStrings.ArgumentsCommandDefinition}
|
2016-11-16 15:49:25 -08:00
|
|
|
|
|
|
|
|
|
Args:
|
2016-12-04 23:24:07 -08:00
|
|
|
|
{LocalizableStrings.ArgsDefinition}
|
2016-11-15 15:42:15 -08:00
|
|
|
|
|
2016-12-04 23:24:07 -08:00
|
|
|
|
{LocalizableStrings.Commands}:
|
|
|
|
|
p2p {LocalizableStrings.CommandP2PDefinition}";
|
2016-11-15 15:42:15 -08:00
|
|
|
|
|
2016-11-29 09:44:39 -08:00
|
|
|
|
protected override Dictionary<string, Func<string[], int>> BuiltInCommands => new Dictionary<string, Func<string[], int>>
|
2016-11-15 15:42:15 -08:00
|
|
|
|
{
|
2016-11-15 16:41:29 -08:00
|
|
|
|
["p2p"] = AddProjectToProjectReferenceCommand.Run,
|
2016-11-15 15:42:15 -08:00
|
|
|
|
};
|
2016-12-07 12:56:27 -08:00
|
|
|
|
|
|
|
|
|
public static int Run(string[] args)
|
|
|
|
|
{
|
|
|
|
|
var cmd = new AddCommand();
|
|
|
|
|
return cmd.Start(args);
|
|
|
|
|
}
|
2016-11-15 15:42:15 -08:00
|
|
|
|
}
|
|
|
|
|
}
|