Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HostingAction for options handlers #2352

Open
derigel23 opened this issue Mar 15, 2024 · 3 comments
Open

HostingAction for options handlers #2352

derigel23 opened this issue Mar 15, 2024 · 3 comments

Comments

@derigel23
Copy link

Currently System.CommandLine.Hosting.HostingExtensions.UseHost set HostingAction wrapper for command and its subcommands actions. But, options can have also own actions and they are not wrapped with HostingAction

@elgonzo
Copy link
Contributor

elgonzo commented Mar 15, 2024

To my knowledge, Options in System.CommandLine do not feature actions. Actions (or handlers, as they were called in older System.CommandLine versions) are features of commands. Could you please clarify what exactly you mean by saying "options can have also own actions"?

(Side note: In case you aren't already aware, please consider reading this announcement: #2338 and issue threads following this announcement.)

@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented Mar 15, 2024

@elgonzo, there's the CliOption.Action property. It was added in #2095 as Option.Action, largely intended for --help and --version.

@elgonzo
Copy link
Contributor

elgonzo commented Mar 15, 2024

@KalleOlaviNiemitalo thanks for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants