Skip to content

[BUG?] Reused arguments are considered optional #1748

Closed

Description

@iBicha

I see in the help builder that an argument used in multiple commands is flagged as optional in usage help

bool IsOptional(Argument argument) =>

            bool IsOptional(Argument argument) =>
                IsMultiParented(argument) ||
                argument.Arity.MinimumNumberOfValues == 0;

Is there a reason for this? We reuse arguments when it makes sense between commands, and they are still required.
I believe this is a bug unless I'm missing something

Activity

  1. changed the title [-]Reused arguments are considered optional[/-] [+][BUG?] Reused arguments are considered optional[/+] on Jun 8, 2022
  2. iBicha commented on Jun 22, 2022

    @iBicha
    ContributorAuthor

    cc @jonsequitur for visibility

  3. added
    bug
    on Jun 22, 2022
  4. added this to the 2.1 milestone on Jun 22, 2022
  5. jonsequitur commented on Jun 22, 2022

    @jonsequitur
    Contributor

    Off the top of my head, I'm not sure what the reason for this is, but the argument being shown as optional (i.e. surrounded by [ ]) is definitely misleading:

    image

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-Helpbug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions