dotnet-installer/src/dotnet/commands/dotnet-build/BuildCommandParser.cs

41 lines
1.9 KiB
C#
Raw Normal View History

// 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.Linq;
using Microsoft.DotNet.Cli.CommandLine;
2017-03-10 13:36:18 -08:00
using LocalizableStrings = Microsoft.DotNet.Tools.Build.LocalizableStrings;
namespace Microsoft.DotNet.Cli
{
internal static class BuildCommandParser
{
public static Command Build() =>
Create.Command(
"build",
2017-03-10 13:36:18 -08:00
LocalizableStrings.AppFullName,
2017-03-14 10:33:58 -07:00
Accept.ZeroOrMoreArguments()
.With(name: "PROJECT",
description:
"The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file."),
CommonOptions.HelpOption(),
Create.Option(
"-o|--output",
2017-03-10 13:36:18 -08:00
LocalizableStrings.OutputOptionDescription,
2017-03-10 17:11:19 -08:00
Accept.ExactlyOneArgument()
2017-03-10 13:36:18 -08:00
.With(name: LocalizableStrings.OutputOptionName)
.ForwardAs(o => $"/p:OutputPath={o.Arguments.Single()}")),
2017-03-09 16:11:58 -08:00
CommonOptions.FrameworkOption(),
CommonOptions.RuntimeOption(),
CommonOptions.ConfigurationOption(),
2017-03-10 01:10:23 -08:00
CommonOptions.VersionSuffixOption(),
Create.Option(
"--no-incremental",
2017-03-10 13:36:18 -08:00
LocalizableStrings.NoIncrementialOptionDescription),
Create.Option(
"--no-dependencies",
2017-03-10 13:36:18 -08:00
LocalizableStrings.NoDependenciesOptionDescription,
2017-03-10 17:11:19 -08:00
Accept.NoArguments()
.ForwardAs("/p:BuildProjectReferences=false")),
CommonOptions.VerbosityOption());
}
}