diff --git a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs index 01ae347c0..4aae155ce 100644 --- a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs @@ -16,12 +16,14 @@ namespace Microsoft.DotNet.Cli CommonOptions.HelpOption(), Create.Option("-f|--framework", "Target framework to publish for. The target framework has to be specified in the project file.", - Accept.WithSuggestionsFrom(_ => Suggest.TargetFrameworksFromProjectFile()) + Accept.ExactlyOneArgument + .WithSuggestionsFrom(_ => Suggest.TargetFrameworksFromProjectFile()) .With(name: "FRAMEWORK") .ForwardAs(o => $"/p:TargetFramework={o.Arguments.Single()}")), Create.Option("-r|--runtime", "Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app.", - Accept.WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile()) + Accept.ExactlyOneArgument + .WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile()) .With(name: "RUNTIME_IDENTIFIER") .ForwardAs(o => $"/p:RuntimeIdentifier={o.Arguments.Single()}")), Create.Option("-o|--output",