From e9435ddcf9844e850e2c117deaeafd0ca13dae33 Mon Sep 17 00:00:00 2001 From: David Anson Date: Thu, 2 Jan 2025 04:53:02 +0000 Subject: [PATCH] Update use of commander for breaking change in v13.0.0. --- README.md | 43 +++++++++++++++++++++++-------------------- markdownlint.js | 4 ++-- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index bf21a79c..1c2b9932 100644 --- a/README.md +++ b/README.md @@ -21,26 +21,29 @@ brew install markdownlint-cli ```bash markdownlint --help - Usage: markdownlint [options] - - MarkdownLint Command Line Interface - - Options: - -V, --version output the version number - -c, --config configuration file (JSON, JSONC, JS, YAML, or TOML) - --configPointer JSON Pointer to object within configuration file (default: "") - -d, --dot include files/folders with a dot (for example `.github`) - -f, --fix fix basic errors (does not work with STDIN) - -i, --ignore file(s) to ignore/exclude (default: []) - -j, --json write issues in json format - -o, --output write issues to file (no console) - -p, --ignore-path path to file with ignore pattern(s) - -q, --quiet do not write issues to STDOUT - -r, --rules include custom rule files (default: []) - -s, --stdin read from STDIN (does not work with files) - --enable Enable certain rules, e.g. --enable MD013 MD041 -- - --disable Disable certain rules, e.g. --disable MD013 MD041 -- - -h, --help display help for command +Usage: markdownlint [options] [files|directories|globs...] + +MarkdownLint Command Line Interface + +Arguments: + files|directories|globs files, directories, and/or globs to lint + +Options: + -V, --version output the version number + -c, --config configuration file (JSON, JSONC, JS, YAML, or TOML) + --configPointer JSON Pointer to object within configuration file (default: "") + -d, --dot include files/folders with a dot (for example `.github`) + -f, --fix fix basic errors (does not work with STDIN) + -i, --ignore file(s) to ignore/exclude (default: []) + -j, --json write issues in json format + -o, --output write issues to file (no console) + -p, --ignore-path path to file with ignore pattern(s) + -q, --quiet do not write issues to STDOUT + -r, --rules include custom rule files (default: []) + -s, --stdin read from STDIN (does not work with files) + --enable Enable certain rules, e.g. --enable MD013 MD041 -- + --disable Disable certain rules, e.g. --disable MD013 MD041 -- + -h, --help display help for command ``` Or run using [Docker](https://www.docker.com) and [GitHub Packages](https://github.com/features/packages): diff --git a/markdownlint.js b/markdownlint.js index d3d9935f..7aa24a62 100755 --- a/markdownlint.js +++ b/markdownlint.js @@ -199,7 +199,6 @@ function concatArray(item, array) { program .version(version) .description(description) - .usage('[options] ') .option('-c, --config ', 'configuration file (JSON, JSONC, JS, YAML, or TOML)') .option('--configPointer ', 'JSON Pointer to object within configuration file', '') .option('-d, --dot', 'include files/folders with a dot (for example `.github`)') @@ -212,7 +211,8 @@ program .option('-r, --rules ', 'include custom rule files', concatArray, []) .option('-s, --stdin', 'read from STDIN (does not work with files)') .option('--enable ', 'Enable certain rules, e.g. --enable MD013 MD041 --') - .option('--disable ', 'Disable certain rules, e.g. --disable MD013 MD041 --'); + .option('--disable ', 'Disable certain rules, e.g. --disable MD013 MD041 --') + .argument('[files|directories|globs...]', 'files, directories, and/or globs to lint'); program.parse(process.argv);