Skip to content

Support validator in args definition  #84

@peterroe

Description

@peterroe

Describe the feature

export default defineCommand({
  meta: {
    name: "Test",
    description: "A test command",
  },
  args: {
    len: {
      type: "string",
      description: "Limit len",
      validator(value) {
        return Number(value) > 24 & Number(value) < 999 ? true : "Len must more than 24 and less than 999 ";
      }
    },
  },
  run({ args }) {
  },
});

Additional information

  • Would you be willing to help implement this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions