Skip to content

gunshi / default / ArgSchema

Interface: ArgSchema

An argument schema This schema is similar to the schema of the node:utils. difference is that:

  • multiple property is not supported
  • required property and description property are added
  • type is not only 'string' and 'boolean', but also 'number', 'enum' and 'positional' too.
  • default property type, not support multiple types

Properties

PropertyTypeDescription
choices?string[] | readonly string[]The allowed values of the argument, and string only. This property is only used when the type is 'enum'.
default?string | number | booleanThe default value of the argument. if the type is 'enum', the default value must be one of the allowed values.
description?stringA description of the argument.
negatable?booleanWhether the negatable option for boolean type
required?trueWhether the argument is required or not.
short?stringA single character alias for the option.
type"string" | "number" | "boolean" | "enum" | "positional"Type of argument.

Released under the MIT License.