diff --git a/src/dotnet/CommonOptions.cs b/src/dotnet/CommonOptions.cs index 174484253..d58dc53f6 100644 --- a/src/dotnet/CommonOptions.cs +++ b/src/dotnet/CommonOptions.cs @@ -30,7 +30,7 @@ namespace Microsoft.DotNet.Cli Create.Option( "-f|--framework", "Target framework to publish for. The target framework has to be specified in the project file.", - Accept.ExactlyOneArgument + Accept.ExactlyOneArgument() .WithSuggestionsFrom(_ => Suggest.TargetFrameworksFromProjectFile()) .With(name: "FRAMEWORK") .ForwardAs(o => $"/p:TargetFramework={o.Arguments.Single()}")); @@ -39,7 +39,7 @@ namespace Microsoft.DotNet.Cli 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.ExactlyOneArgument + Accept.ExactlyOneArgument() .WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile()) .With(name: "RUNTIME_IDENTIFIER") .ForwardAs(o => $"/p:RuntimeIdentifier={o.Arguments.Single()}")); @@ -48,7 +48,7 @@ namespace Microsoft.DotNet.Cli Create.Option( "-c|--configuration", "Configuration to use for building the project. Default for most projects is \"Debug\".", - Accept.ExactlyOneArgument + Accept.ExactlyOneArgument() .With(name: "CONFIGURATION") .WithSuggestionsFrom("DEBUG", "RELEASE") .ForwardAs(o => $"/p:Configuration={o.Arguments.Single()}")); @@ -57,7 +57,7 @@ namespace Microsoft.DotNet.Cli Create.Option( "--version-suffix", "Defines the value for the $(VersionSuffix) property in the project.", - Accept.ExactlyOneArgument + Accept.ExactlyOneArgument() .With(name: "VERSION_SUFFIX") .ForwardAs(o => $"/p:VersionSuffix={o.Arguments.Single()}")); diff --git a/src/dotnet/commands/dotnet-cache/CacheCommandParser.cs b/src/dotnet/commands/dotnet-cache/CacheCommandParser.cs index b314e6c37..1c5985152 100644 --- a/src/dotnet/commands/dotnet-cache/CacheCommandParser.cs +++ b/src/dotnet/commands/dotnet-cache/CacheCommandParser.cs @@ -13,12 +13,12 @@ namespace Microsoft.DotNet.Cli Create.Command( "cache", LocalizableStrings.AppDescription, - Accept.ZeroOrMoreArguments, + Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), Create.Option( "-e|--entries", LocalizableStrings.ProjectEntryDescription, - Accept.OneOrMoreArguments + Accept.OneOrMoreArguments() .With(name: LocalizableStrings.ProjectEntries) .ForwardAs(o => { @@ -34,7 +34,7 @@ namespace Microsoft.DotNet.Cli Create.Option( "--framework-version", LocalizableStrings.FrameworkVersionOptionDescription, - Accept.ExactlyOneArgument + Accept.ExactlyOneArgument() .With(name: LocalizableStrings.FrameworkVersionOption) .ForwardAs(o => $"/p:FX_Version={o.Arguments.Single()}")), CommonOptions.RuntimeOption(), @@ -42,24 +42,24 @@ namespace Microsoft.DotNet.Cli Create.Option( "-o|--output", LocalizableStrings.OutputOptionDescription, - Accept.ExactlyOneArgument + Accept.ExactlyOneArgument() .With(name: LocalizableStrings.OutputOption) .ForwardAs(o => $"/p:ComposeDir={o.Arguments.Single()}")), Create.Option( "-w|--working-dir", LocalizableStrings.IntermediateWorkingDirOptionDescription, - Accept.ExactlyOneArgument + Accept.ExactlyOneArgument() .With(name: LocalizableStrings.IntermediateWorkingDirOption) .ForwardAs(o => $"/p:ComposeWorkingDir={o.Arguments.Single()}")), Create.Option( "--preserve-working-dir", LocalizableStrings.PreserveIntermediateWorkingDirOptionDescription, - Accept.NoArguments + Accept.NoArguments() .ForwardAs(o => $"/p:PreserveComposeWorkingDir=true")), Create.Option( "--skip-optimization", LocalizableStrings.SkipOptimizationOptionDescription, - Accept.NoArguments + Accept.NoArguments() .ForwardAs("/p:SkipOptimization=true")), CommonOptions.VerbosityOption()); } diff --git a/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs b/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs index 50db53d60..d157d9d52 100644 --- a/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs +++ b/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs @@ -13,7 +13,7 @@ namespace Microsoft.DotNet.Cli Create.Command( "clean", LocalizableStrings.AppFullName, - Accept.ZeroOrMoreArguments, + Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), Create.Option("-o|--output", LocalizableStrings.CmdOutputDirDescription, diff --git a/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs b/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs index 738a95110..fc64a0c74 100644 --- a/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs +++ b/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs @@ -14,7 +14,7 @@ namespace Microsoft.DotNet.Cli Create.Command( "migrate", ".NET Migrate Command", - Accept.ZeroOrOneArgument + Accept.ZeroOrOneArgument() .MaterializeAs(o => { return new MigrateCommand( diff --git a/src/dotnet/commands/dotnet-pack/PackCommandParser.cs b/src/dotnet/commands/dotnet-pack/PackCommandParser.cs index 75b52a7ab..d1e64e86c 100644 --- a/src/dotnet/commands/dotnet-pack/PackCommandParser.cs +++ b/src/dotnet/commands/dotnet-pack/PackCommandParser.cs @@ -13,28 +13,32 @@ namespace Microsoft.DotNet.Cli Create.Command( "pack", LocalizableStrings.AppDescription, - Accept.ZeroOrMoreArguments, + Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), Create.Option( "-o|--output", LocalizableStrings.CmdOutputDirDescription, - Accept.ExactlyOneArgument() + Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdOutputDir) .ForwardAs(o => $"/p:PackageOutputPath={o.Arguments.Single()}")), - Create.Option("--no-build", - LocalizableStrings.CmdNoBuildOptionDescription, - Accept.NoArguments.ForwardAs("/p:NoBuild=true")), - Create.Option("--include-symbols", - LocalizableStrings.CmdIncludeSymbolsDescription, - Accept.NoArguments.ForwardAs("/p:IncludeSymbols=true")), - Create.Option("--include-source", - LocalizableStrings.CmdIncludeSourceDescription, - Accept.NoArguments.ForwardAs("/p:IncludeSource=true")), + Create.Option( + "--no-build", + LocalizableStrings.CmdNoBuildOptionDescription, + Accept.NoArguments().ForwardAs("/p:NoBuild=true")), + Create.Option( + "--include-symbols", + LocalizableStrings.CmdIncludeSymbolsDescription, + Accept.NoArguments().ForwardAs("/p:IncludeSymbols=true")), + Create.Option( + "--include-source", + LocalizableStrings.CmdIncludeSourceDescription, + Accept.NoArguments().ForwardAs("/p:IncludeSource=true")), CommonOptions.ConfigurationOption(), CommonOptions.VersionSuffixOption(), - Create.Option("-s|--serviceable", - LocalizableStrings.CmdServiceableDescription, - Accept.NoArguments.ForwardAs("/p:Serviceable=true")), + Create.Option( + "-s|--serviceable", + LocalizableStrings.CmdServiceableDescription, + Accept.NoArguments().ForwardAs("/p:Serviceable=true")), CommonOptions.VerbosityOption()); } } \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs index e62a36de6..e40cac535 100644 --- a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs @@ -24,6 +24,7 @@ namespace Microsoft.DotNet.Cli .With(name: LocalizableStrings.OutputOption) .ForwardAs(o => $"/p:PublishDir={o.Arguments.Single()}")), CommonOptions.ConfigurationOption(), + Create.Option( "--filter", LocalizableStrings.FilterProjOptionDescription, Accept.ExactlyOneArgument() diff --git a/src/dotnet/commands/dotnet-test/TestCommandParser.cs b/src/dotnet/commands/dotnet-test/TestCommandParser.cs index e35feb0ec..f707ce502 100644 --- a/src/dotnet/commands/dotnet-test/TestCommandParser.cs +++ b/src/dotnet/commands/dotnet-test/TestCommandParser.cs @@ -11,35 +11,35 @@ namespace Microsoft.DotNet.Cli Create.Command( "test", LocalizableStrings.AppFullName, - Accept.ZeroOrMoreArguments, + Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), Create.Option( "-s|--settings", LocalizableStrings.CmdSettingsDescription, - Accept.ExactlyOneArgument() + Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdSettingsFile) .ForwardAs(o => $"/p:VSTestSetting={o.Arguments.Single()}")), Create.Option( "-t|--list-tests", LocalizableStrings.CmdListTestsDescription, - Accept.NoArguments + Accept.NoArguments() .ForwardAs(o => "/p:VSTestListTests=true")), Create.Option( "--filter", LocalizableStrings.CmdTestCaseFilterDescription, - Accept.ExactlyOneArgument() + Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdTestCaseFilterExpression) .ForwardAs(o => $"/p:VSTestTestCaseFilter={o.Arguments.Single()}")), Create.Option( "-a|--test-adapter-path", LocalizableStrings.CmdTestAdapterPathDescription, - Accept.ExactlyOneArgument() + Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdTestAdapterPath) .ForwardAs(o => $"/p:VSTestTestAdapterPath={o.Arguments.Single()}")), Create.Option( "-l|--logger", LocalizableStrings.CmdLoggerDescription, - Accept.ExactlyOneArgument() + Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdLoggerOption) .ForwardAs(o => { @@ -52,19 +52,19 @@ namespace Microsoft.DotNet.Cli Create.Option( "-o|--output", LocalizableStrings.CmdOutputDescription, - Accept.ExactlyOneArgument() + Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdOutputDir) .ForwardAs(o => $"/p:OutputPath={o.Arguments.Single()}")), Create.Option( "-d|--diag", LocalizableStrings.CmdPathTologFileDescription, - Accept.ExactlyOneArgument() + Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdPathToLogFile) .ForwardAs(o => $"/p:VSTestDiag={o.Arguments.Single()}")), Create.Option( "--no-build", LocalizableStrings.CmdNoBuildDescription, - Accept.NoArguments + Accept.NoArguments() .ForwardAs(o => "/p:VSTestNoBuild=true")), CommonOptions.VerbosityOption());