Skip to content

[main] The number arg is forced to be provided regardless of the required setting #193

Closed

Description

@kricsleo

Environment

citty: latest main branch (not released yet)
nodejs: v22.14.0

Reproduction

https://stackblitz.com/edit/github-4ucwxh7s?file=playground%2Fhello.mjs&startScript=build

run node playground/hello.mjs hi:

[3:08:08 PM] ERROR Invalid value for argument: --age (undefined). Expected a number.

Describe the bug

The age is set to required: false, but it still forces parsing and throws an error.

    age: {
      type: "number",
      description: "Your age",
      required: false,
    },

Additional context

No response

Logs

Activity

  1. added
    bug
    on Apr 8, 2025
  2. changed the title [-]The `number` arg is forced to be provided regardless of the `required` setting[/-] [+][main] The `number` arg is forced to be provided regardless of the `required` setting[/+] on Apr 8, 2025
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions