From 6a1fe098b5e7c5a30ce52ff66a0bd2f2d0c44aa8 Mon Sep 17 00:00:00 2001 From: escapedcat Date: Wed, 11 Sep 2024 16:55:34 +0800 Subject: [PATCH] docs: add result info to config option #4241 --- @commitlint/cli/src/cli.test.ts | 2 +- @commitlint/cli/src/cli.ts | 3 ++- docs/reference/cli.md | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/@commitlint/cli/src/cli.test.ts b/@commitlint/cli/src/cli.test.ts index d6a8c66ba7..d2f44c50d4 100644 --- a/@commitlint/cli/src/cli.test.ts +++ b/@commitlint/cli/src/cli.test.ts @@ -581,7 +581,7 @@ test('should print help', async () => { Options: -c, --color toggle colored output [boolean] [default: true] - -g, --config path to the config file [string] + -g, --config path to the config file; result code 9 if config is missing [string] --print-config print resolved config [string] [choices: "", "text", "json"] -d, --cwd directory to execute in [string] [default: (Working Directory)] -e, --edit read last commit message from the specified file or fallbacks to ./.git/COMMIT_EDITMSG [string] diff --git a/@commitlint/cli/src/cli.ts b/@commitlint/cli/src/cli.ts index 421eeb692b..93ce1cab36 100644 --- a/@commitlint/cli/src/cli.ts +++ b/@commitlint/cli/src/cli.ts @@ -47,7 +47,8 @@ const cli = yargs(process.argv.slice(2)) }, config: { alias: 'g', - description: 'path to the config file', + description: + 'path to the config file; result code 9 if config is missing', type: 'string', }, 'print-config': { diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 3aead4ec83..1071966500 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -3,13 +3,14 @@ ```sh ❯ npx commitlint --help -@commitlint/cli@19.3.0 - Lint your commit messages +@commitlint/cli@19.5.0 - Lint your commit messages [input] reads from stdin if --edit, --env, --from and --to are omitted Options: -c, --color toggle colored output [boolean] [default: true] - -g, --config path to the config file [string] + -g, --config path to the config file; result code 9 if config is + missing [string] --print-config print resolved config [string] [choices: "", "text", "json"] -d, --cwd directory to execute in