Skip to content

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

Description

@jonsequitur
        // 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);

Activity

  1. added
    needs discussion
    on Nov 2, 2022
  2. KalleOlaviNiemitalo commented on Nov 5, 2022

    @KalleOlaviNiemitalo

    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.

  3. added this to the 2.0 GA milestone on Nov 9, 2022
  4. KalleOlaviNiemitalo commented on Feb 28, 2023

    @KalleOlaviNiemitalo

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

  5. KalleOlaviNiemitalo commented on Feb 28, 2023

    @KalleOlaviNiemitalo

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

  6. jonsequitur commented on Mar 1, 2023

    @jonsequitur
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-APIneeds discussion

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions