Centralize VersionSuffixOption

This commit is contained in:
Piotr Puszkiewicz 2017-03-10 01:10:23 -08:00
parent dc72b7ce92
commit 92245e4523
3 changed files with 10 additions and 10 deletions

View file

@ -53,6 +53,14 @@ namespace Microsoft.DotNet.Cli
.WithSuggestionsFrom("DEBUG", "RELEASE")
.ForwardAs(o => $"/p:Configuration={o.Arguments.Single()}"));
public static Option VersionSuffixOption() =>
Create.Option(
"--version-suffix",
"Defines the value for the $(VersionSuffix) property in the project.",
Accept.ExactlyOneArgument
.With(name: "VERSION_SUFFIX")
.ForwardAs(o => $"/p:VersionSuffix={o.Arguments.Single()}"));
public static ArgumentsRule DefaultToCurrentDirectory(this ArgumentsRule rule) =>
rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()));
}

View file

@ -23,12 +23,7 @@ namespace Microsoft.DotNet.Cli
CommonOptions.FrameworkOption(),
CommonOptions.RuntimeOption(),
CommonOptions.ConfigurationOption(),
Create.Option(
"--version-suffix",
"Defines the value for the $(VersionSuffix) property in the project",
Accept.ExactlyOneArgument
.With(name: "VERSION_SUFFIX")
.ForwardAs(o => $"/p:VersionSuffix={o.Arguments.Single()}")),
CommonOptions.VersionSuffixOption(),
Create.Option(
"--no-incremental",
"Disables incremental build."),

View file

@ -22,10 +22,7 @@ namespace Microsoft.DotNet.Cli
.With(name: "OUTPUT_DIR")
.ForwardAs(o => $"/p:PublishDir={o.Arguments.Single()}")),
CommonOptions.ConfigurationOption(),
Create.Option("--version-suffix", "Defines the value for the $(VersionSuffix) property in the project.",
Accept.ExactlyOneArgument
.With(name: "VERSION_SUFFIX")
.ForwardAs(o => $"/p:VersionSuffix={o.Arguments.Single()}")),
CommonOptions.VersionSuffixOption(),
Create.Option("--filter", "The XML file that contains the list of packages to be excluded from publish step.",
Accept.ExactlyOneArgument
.With(name: "PROFILE_XML")