Centralize VersionSuffixOption
This commit is contained in:
parent
dc72b7ce92
commit
92245e4523
3 changed files with 10 additions and 10 deletions
|
@ -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()));
|
||||
}
|
||||
|
|
|
@ -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."),
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue