add additional args to dotnet run help

This commit is contained in:
jonsequitur 2017-03-19 14:35:11 -07:00
parent 43c13f2f53
commit b4cf73ec20
2 changed files with 25 additions and 29 deletions

View file

@ -16,14 +16,10 @@ namespace Microsoft.DotNet.Tools.Run
public string Configuration { get; set; }
public string Framework { get; set; }
public string Project { get; set; }
public IReadOnlyList<string> Args { get; set; }
public IReadOnlyCollection<string> Args { get; set; }
private List<string> _args;
public RunCommand()
{
}
public int Start()
{
Initialize();

View file

@ -1,7 +1,6 @@
// 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.Tools.Run;
using LocalizableStrings = Microsoft.DotNet.Tools.Run.LocalizableStrings;
@ -14,17 +13,17 @@ namespace Microsoft.DotNet.Cli
Create.Command(
"run",
LocalizableStrings.AppFullName,
Accept.ZeroOrMoreArguments()
.MaterializeAs(o =>
{
return new RunCommand()
treatUnmatchedTokensAsErrors: false,
arguments: Accept.ZeroOrMoreArguments()
.MaterializeAs(o => new RunCommand
{
Configuration = o.SingleArgumentOrDefault("--configuration"),
Framework = o.SingleArgumentOrDefault("--framework"),
Project = o.SingleArgumentOrDefault("--project"),
Args = (IReadOnlyList<string>)o.Arguments
};
Args = o.Arguments
}),
options: new[]
{
CommonOptions.HelpOption(),
CommonOptions.ConfigurationOption(),
CommonOptions.FrameworkOption(),
@ -35,6 +34,7 @@ namespace Microsoft.DotNet.Cli
Create.Option(
"--no-build",
LocalizableStrings.CommandOptionNoBuildDescription,
Accept.NoArguments().ForwardAs("/p:NoBuild=true")));
Accept.NoArguments().ForwardAs("/p:NoBuild=true"))
});
}
}