2017-03-06 11:57:19 -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.
|
|
|
|
|
2017-03-10 09:08:01 -08:00
|
|
|
using System.Collections.Generic;
|
2017-03-06 11:57:19 -08:00
|
|
|
using Microsoft.DotNet.Cli.CommandLine;
|
2017-03-10 09:08:01 -08:00
|
|
|
using Microsoft.DotNet.Tools.Run;
|
|
|
|
using LocalizableStrings = Microsoft.DotNet.Tools.Run.LocalizableStrings;
|
2017-03-06 11:57:19 -08:00
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli
|
|
|
|
{
|
|
|
|
internal static class RunCommandParser
|
|
|
|
{
|
|
|
|
public static Command Run() =>
|
2017-03-10 09:08:01 -08:00
|
|
|
Create.Command(
|
|
|
|
"run",
|
2017-03-10 13:36:18 -08:00
|
|
|
LocalizableStrings.AppFullName,
|
2017-03-10 17:37:26 -08:00
|
|
|
Accept.ZeroOrMoreArguments()
|
2017-03-10 10:13:11 -08:00
|
|
|
.MaterializeAs(o =>
|
2017-03-10 09:08:01 -08:00
|
|
|
{
|
2017-03-10 10:13:11 -08:00
|
|
|
return new RunCommand()
|
|
|
|
{
|
|
|
|
Configuration = o.SingleArgumentOrDefault("--configuration"),
|
|
|
|
Framework = o.SingleArgumentOrDefault("--framework"),
|
|
|
|
Project = o.SingleArgumentOrDefault("--project"),
|
|
|
|
Args = (IReadOnlyList<string>)o.Arguments
|
|
|
|
};
|
|
|
|
}),
|
2017-03-10 09:08:01 -08:00
|
|
|
CommonOptions.HelpOption(),
|
|
|
|
CommonOptions.ConfigurationOption(),
|
|
|
|
CommonOptions.FrameworkOption(),
|
|
|
|
Create.Option(
|
|
|
|
"-p|--project",
|
|
|
|
LocalizableStrings.CommandOptionProjectDescription,
|
2017-03-16 02:39:48 -07:00
|
|
|
Accept.ExactlyOneArgument()),
|
|
|
|
Create.Option(
|
|
|
|
"--no-build",
|
|
|
|
LocalizableStrings.CommandOptionNoBuildDescription,
|
|
|
|
Accept.NoArguments().ForwardAs("/p:NoBuild=true")));
|
2017-03-06 11:57:19 -08:00
|
|
|
}
|
2017-03-16 02:39:48 -07:00
|
|
|
}
|