move dotnet-run
This commit is contained in:
parent
a751673172
commit
940dd6863a
4 changed files with 27 additions and 13 deletions
|
@ -17,5 +17,14 @@ namespace Microsoft.DotNet.Cli
|
||||||
.Select(o => o.Value<T>())
|
.Select(o => o.Value<T>())
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string SingleArgumentOrDefault(this AppliedOption parseResult, string alias)
|
||||||
|
{
|
||||||
|
return parseResult
|
||||||
|
.AppliedOptions
|
||||||
|
.Where(o => o.HasAlias(alias))
|
||||||
|
.Select(o => o.Arguments.Single())
|
||||||
|
.SingleOrDefault();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -39,6 +39,11 @@ namespace Microsoft.DotNet.Cli
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() => _value;
|
public override string ToString() => _value;
|
||||||
|
|
||||||
|
public static explicit operator string(ForwardedArgument argument)
|
||||||
|
{
|
||||||
|
return argument.ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -15,16 +15,16 @@ namespace Microsoft.DotNet.Cli
|
||||||
"run",
|
"run",
|
||||||
".NET Run Command",
|
".NET Run Command",
|
||||||
Accept.ZeroOrMoreArguments
|
Accept.ZeroOrMoreArguments
|
||||||
.MaterializeAs(o =>
|
.MaterializeAs(o =>
|
||||||
{
|
|
||||||
return new RunCommand()
|
|
||||||
{
|
{
|
||||||
Configuration = o.ValueOrDefault<string>("--configuration"),
|
return new RunCommand()
|
||||||
Framework = o.ValueOrDefault<string>("--framework"),
|
{
|
||||||
Project = o.ValueOrDefault<string>("--project"),
|
Configuration = o.SingleArgumentOrDefault("--configuration"),
|
||||||
Args = (IReadOnlyList<string>)o.Arguments
|
Framework = o.SingleArgumentOrDefault("--framework"),
|
||||||
};
|
Project = o.SingleArgumentOrDefault("--project"),
|
||||||
}),
|
Args = (IReadOnlyList<string>)o.Arguments
|
||||||
|
};
|
||||||
|
}),
|
||||||
CommonOptions.HelpOption(),
|
CommonOptions.HelpOption(),
|
||||||
CommonOptions.ConfigurationOption(),
|
CommonOptions.ConfigurationOption(),
|
||||||
CommonOptions.FrameworkOption(),
|
CommonOptions.FrameworkOption(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue