You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
There is an open issue in the cake project, cake-build/cake#3279, which has been triaged and accepted as an improvement, to 'Allow users to use any of the Cake runner arguments as build script arguments'
An example of what this practically means is as follows. Here is a flag currently defined on the cake DefaultCommandSettings class:
[CommandOption("--version|--ver")]
[Description("Displays version information.")]
public bool ShowVersion { get; set; }
And normally the user would invoke this by dotnet cake --version.
However, sometimes the user would like to specify a version number and have it pass to their build script instead. Currently they must write dotnet cake -- --version=1.2.3 to explicitly ensure the version number is parsed as a remaining argument, not a command setting.
The above issue, cake-build/cake#3279, would allow dotnet cake --version=1.2.3 to add version=1.2.3 to the remaining arguments list, and dotnet cake --version to set the ShowVersion property to true (ie. continue operating as current).
Describe the solution you'd like
A configuration setting that informs the command parsing logic to catch any exceptions thrown when setting values on the command settings class (eg. Flags cannot be assigned a value.) and instead add the option and its value to the remaining arguments list. This configuration setting could be turned off as a default to ensure backward compatibility with existing behaviour.
(This solution depends on #1048 being merged, so that command options (and their values) work nicely ahead of any arguments)
Describe alternatives you've considered
Should this feature be deemed as not viable for spectre.console for any reason, I would look to see how the exception could be caught higher up in the cake codebase, and/or some kind of extension point being opened within the command parsing logic perhaps. And then subsequently some way to inject the caught value back into the remaining args from the cake codebase [pretty ugly sounding]. I think, however, the solution proposed above is a clean and generic improvement to spectre console whilst also preserving existing behaviour.
nb. please assign the issue to me @patriksvensson if it successfully makes it out of triage 🙂
The text was updated successfully, but these errors were encountered:
FrankRay78
changed the title
Ability to add command line values to remaining arguments if they cannot be set on the settings class
Ability to add command line flags and their values to remaining arguments if they cannot be set on the settings class
Nov 10, 2022
Is your feature request related to a problem? Please describe.
There is an open issue in the cake project, cake-build/cake#3279, which has been triaged and accepted as an improvement, to 'Allow users to use any of the Cake runner arguments as build script arguments'
An example of what this practically means is as follows. Here is a flag currently defined on the cake
DefaultCommandSettings
class:And normally the user would invoke this by
dotnet cake --version
.However, sometimes the user would like to specify a version number and have it pass to their build script instead. Currently they must write
dotnet cake -- --version=1.2.3
to explicitly ensure the version number is parsed as a remaining argument, not a command setting.The above issue, cake-build/cake#3279, would allow
dotnet cake --version=1.2.3
to add version=1.2.3 to the remaining arguments list, anddotnet cake --version
to set the ShowVersion property to true (ie. continue operating as current).Describe the solution you'd like
A configuration setting that informs the command parsing logic to catch any exceptions thrown when setting values on the command settings class (eg.
Flags cannot be assigned a value.
) and instead add the option and its value to the remaining arguments list. This configuration setting could be turned off as a default to ensure backward compatibility with existing behaviour.(This solution depends on #1048 being merged, so that command options (and their values) work nicely ahead of any arguments)
Describe alternatives you've considered
Should this feature be deemed as not viable for spectre.console for any reason, I would look to see how the exception could be caught higher up in the cake codebase, and/or some kind of extension point being opened within the command parsing logic perhaps. And then subsequently some way to inject the caught value back into the remaining args from the cake codebase [pretty ugly sounding]. I think, however, the solution proposed above is a clean and generic improvement to spectre console whilst also preserving existing behaviour.
nb. please assign the issue to me @patriksvensson if it successfully makes it out of triage 🙂
The text was updated successfully, but these errors were encountered: