From 7f71cf107da1f7822b3364b8655b4e311250a559 Mon Sep 17 00:00:00 2001 From: Ion Gireada Date: Mon, 8 Dec 2025 16:09:28 +0200 Subject: [PATCH] refactor(schema)!: Remove `variadic` property from CLI options definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `variadic` property has been removed from the definition of CLI options in `cli.schema.json`. This property previously allowed specifying if an option could accept multiple values. This removal simplifies the schema and its usage, streamlining how CLI options are defined. The `README.md` has been updated to reflect this change by removing the `variadic` entry from the 'Options' table. Furthermore, two crucial sections in the `README.md`—one concerning the mandatory top-level `cli` object and another about the structure of the `default` object—have been enhanced with `[!IMPORTANT]` admonitions to improve their visibility and emphasis. BREAKING CHANGE: This commit introduces breaking changes. --- README.md | 7 ++++--- schema/cli.schema.json | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9657893..38431a8 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,8 @@ While the examples show a simple command, the schema is designed to handle enter ## Schema Reference -All CLI definitions must be nested under a top-level `cli` object. This root object is mandatory and serves as the container for all commands, arguments, and options that define your command-line interface. While other properties can exist alongside the `cli` object, they will not be validated by the schema. +> [!IMPORTANT] +> All CLI definitions must be nested under a top-level `cli` object. This root object is mandatory and serves as the container for all commands, arguments, and options that define your command-line interface. While other properties can exist alongside the `cli` object, they will not be validated by the schema. ### The `cli` Object @@ -176,11 +177,11 @@ The `cli-schema` defines the structure for your CLI definition file. Here are th | `required` | `boolean` | Whether the option is required. Defaults to `false`. | | `short` | `string` | The single-letter short alias (e.g., `p`). Must be `^[a-zA-Z]$`. | | `type` | `string` | The data type. Can be `string`, `number`, `boolean`. | -| `variadic` | `boolean` | Whether the option can accept multiple values. Defaults to `false`. | ### The `default` Object -The `default` object is used to define a default value for an `argument` or `option`. It must have exactly one of the following properties: +> [!IMPORTANT] +> The `default` object is used to define a default value for an `argument` or `option`. It must have exactly one of the following properties: | Property | Type | Description | | ------------ | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | diff --git a/schema/cli.schema.json b/schema/cli.schema.json index df76f78..2404719 100644 --- a/schema/cli.schema.json +++ b/schema/cli.schema.json @@ -57,7 +57,6 @@ "short": { "type": "string", "pattern": "^[a-zA-Z]$" }, "description": { "type": "string" }, "type": { "enum": ["string", "number", "boolean"] }, - "variadic": { "type": "boolean" }, "required": { "type": "boolean" }, "choices": { "type": "array",