diff --git a/src/Cli/Microsoft.DotNet.Cli.CommandLine/ForwardedOptionExtensions.cs b/src/Cli/Microsoft.DotNet.Cli.CommandLine/ForwardedOptionExtensions.cs index 040f4595f7b8..b4a3e9aeb819 100644 --- a/src/Cli/Microsoft.DotNet.Cli.CommandLine/ForwardedOptionExtensions.cs +++ b/src/Cli/Microsoft.DotNet.Cli.CommandLine/ForwardedOptionExtensions.cs @@ -177,12 +177,16 @@ public Option> ForwardAsManyArgumentsEachPrefixedByOption(st /// /// Calls the forwarding functions for all options that have declared a forwarding function (via 's extension members) in the provided . /// - /// /// If not provided, uses the 's . - /// - public IEnumerable OptionValuesToBeForwarded(Command? command = null) => - (command ?? parseResult.CommandResult.Command) - .Options + public IEnumerable OptionValuesToBeForwarded(Command? command = null) + => parseResult.OptionValuesToBeForwarded((command ?? parseResult.CommandResult.Command).Options); + + /// + /// Calls the forwarding functions for all options that have declared a forwarding function (via 's extension members) in the provided . + /// + /// If not provided, uses the 's . + public IEnumerable OptionValuesToBeForwarded(IEnumerable