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

Consider a better word than "global" since it actually indicates that the option is syntactically valid on the current command and its subcommands #1904

Closed
Tracked by #1891
jonsequitur opened this issue Nov 2, 2022 · 4 comments
Labels
Area-API needs discussion Further discussion required
Milestone

Comments

@jonsequitur
Copy link
Contributor

jonsequitur commented Nov 2, 2022

        // I assume that a caller of this will understand the difference of a Global option and a non-Global option
        public void AddGlobalOption(Option option);
@jonsequitur jonsequitur mentioned this issue Nov 2, 2022
56 tasks
@jonsequitur jonsequitur added Area-API needs discussion Further discussion required labels Nov 2, 2022
@KalleOlaviNiemitalo
Copy link

Add(Option option, bool inheritable) would allow initializer list syntax; but the resulting code would not be very easy to understand. The bool could be replaced with OptionOptions.ValidInSubcommands but that would mean larger API and the name looks bad.

@jonsequitur jonsequitur added this to the 2.0 GA milestone Nov 9, 2022
@KalleOlaviNiemitalo
Copy link

This was done in #2060, by replacing Command.AddGlobalOption with Option.AppliesToSelfAndChildren.

@KalleOlaviNiemitalo
Copy link

"AppliesToSelfAndChildren" would have been a bit misleading if #2063 had allowed directives as children of a command.

@jonsequitur
Copy link
Contributor Author

Thanks, @KalleOlaviNiemitalo. I'll close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-API needs discussion Further discussion required
Projects
None yet
Development

No branches or pull requests

2 participants