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")
|
.WithSuggestionsFrom("DEBUG", "RELEASE")
|
||||||
.ForwardAs(o => $"/p:Configuration={o.Arguments.Single()}"));
|
.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) =>
|
public static ArgumentsRule DefaultToCurrentDirectory(this ArgumentsRule rule) =>
|
||||||
rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()));
|
rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,12 +23,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
CommonOptions.FrameworkOption(),
|
CommonOptions.FrameworkOption(),
|
||||||
CommonOptions.RuntimeOption(),
|
CommonOptions.RuntimeOption(),
|
||||||
CommonOptions.ConfigurationOption(),
|
CommonOptions.ConfigurationOption(),
|
||||||
Create.Option(
|
CommonOptions.VersionSuffixOption(),
|
||||||
"--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()}")),
|
|
||||||
Create.Option(
|
Create.Option(
|
||||||
"--no-incremental",
|
"--no-incremental",
|
||||||
"Disables incremental build."),
|
"Disables incremental build."),
|
||||||
|
|
|
@ -22,10 +22,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
.With(name: "OUTPUT_DIR")
|
.With(name: "OUTPUT_DIR")
|
||||||
.ForwardAs(o => $"/p:PublishDir={o.Arguments.Single()}")),
|
.ForwardAs(o => $"/p:PublishDir={o.Arguments.Single()}")),
|
||||||
CommonOptions.ConfigurationOption(),
|
CommonOptions.ConfigurationOption(),
|
||||||
Create.Option("--version-suffix", "Defines the value for the $(VersionSuffix) property in the project.",
|
CommonOptions.VersionSuffixOption(),
|
||||||
Accept.ExactlyOneArgument
|
|
||||||
.With(name: "VERSION_SUFFIX")
|
|
||||||
.ForwardAs(o => $"/p:VersionSuffix={o.Arguments.Single()}")),
|
|
||||||
Create.Option("--filter", "The XML file that contains the list of packages to be excluded from publish step.",
|
Create.Option("--filter", "The XML file that contains the list of packages to be excluded from publish step.",
|
||||||
Accept.ExactlyOneArgument
|
Accept.ExactlyOneArgument
|
||||||
.With(name: "PROFILE_XML")
|
.With(name: "PROFILE_XML")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue