Skip to content

Commit

Permalink
feat: support CLI options from JSON file or Common.js module
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Quarmby committed Jul 31, 2024
1 parent ed321d4 commit 0a7b1c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions @commitlint/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ const cli = yargs(process.argv.slice(2))
.alias('v', 'version')
.help('help')
.alias('h', 'help')
.config(
'options',
'path to a JSON file or Common.js module containing CLI options',
require
)
.usage(`${pkg.name}@${pkg.version} - ${pkg.description}\n`)
.usage(
`[input] reads from stdin if --edit, --env, --from and --to are omitted`
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Options:
[boolean]
-s, --strict enable strict mode; result code 2 for warnings, 3 for
errors [boolean]
--options path to a JSON file or Common.js module containing CLI
options
-v, --version display version information [boolean]
-h, --help Show help [boolean]
```

0 comments on commit 0a7b1c6

Please sign in to comment.