2017-12-04 14:13:24 -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.
|
|
|
|
|
2018-01-11 13:54:02 -08:00
|
|
|
using System.Linq;
|
2017-12-04 14:13:24 -08:00
|
|
|
using Microsoft.DotNet.Cli.CommandLine;
|
2018-01-11 13:54:02 -08:00
|
|
|
using Microsoft.DotNet.Tools.Install.Tool;
|
|
|
|
using LocalizableStrings = Microsoft.DotNet.Tools.Install.LocalizableStrings;
|
2017-12-04 14:13:24 -08:00
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli
|
|
|
|
{
|
|
|
|
internal static class InstallToolCommandParser
|
|
|
|
{
|
|
|
|
public static Command InstallTool()
|
|
|
|
{
|
|
|
|
return Create.Command("tool",
|
|
|
|
"Install tool",
|
|
|
|
Accept.ExactlyOneArgument(o => "packageId")
|
|
|
|
.With(name: "packageId",
|
|
|
|
description: "Package Id in NuGet"),
|
|
|
|
Create.Option(
|
|
|
|
"--version",
|
|
|
|
"Version of the package in NuGet",
|
|
|
|
Accept.ExactlyOneArgument()),
|
|
|
|
Create.Option(
|
|
|
|
"--configfile",
|
|
|
|
"NuGet configuration file",
|
|
|
|
Accept.ExactlyOneArgument()),
|
2018-01-11 13:54:02 -08:00
|
|
|
Create.Option(
|
|
|
|
"--source",
|
|
|
|
LocalizableStrings.SourceOptionDescription,
|
|
|
|
Accept.ExactlyOneArgument()
|
|
|
|
.With(name: LocalizableStrings.SourceOptionName)),
|
2017-12-04 14:13:24 -08:00
|
|
|
Create.Option(
|
|
|
|
"-f|--framework",
|
|
|
|
"Target framework to publish for. The target framework has to be specified in the project file.",
|
|
|
|
Accept.ExactlyOneArgument()),
|
|
|
|
CommonOptions.HelpOption());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|