From d68a4fdc42a6306cb2d77a7a0786603543ce2db8 Mon Sep 17 00:00:00 2001 From: Lloyd Brookes Date: Fri, 30 Aug 2024 14:43:40 +0100 Subject: [PATCH] Update readme, fix exception handling --- README.md | 2 -- bin/cli.js | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e26214b..7cef946 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ [![Node.js CI](https://github.com/jsdoc2md/jsdoc-to-markdown/actions/workflows/node.js.yml/badge.svg)](https://github.com/jsdoc2md/jsdoc-to-markdown/actions/workflows/node.js.yml) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard) -# jsdoc-to-markdown - _Upgraders, please read the [release notes](https://github.com/jsdoc2md/jsdoc-to-markdown/releases)_ # jsdoc-to-markdown diff --git a/bin/cli.js b/bin/cli.js index 0c40377..d103335 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -39,12 +39,11 @@ if (options.help) { /* input files (jsdoc-options) required from here */ /* input validation */ - try { - options.files = options.files || [] - assert.ok(options.files.length || options.source, 'Must supply either --files or --source') - } catch (err) { + options.files = options.files || [] + if (!(options.files.length || options.source || options.configure)) { + console.error('Must supply either --files, --source or --configure') console.log(cli.usage) - handleError(err) + process.exit(1) } /* jsdoc2md --json */ @@ -100,4 +99,5 @@ function parseCommandLine () { function handleError (err) { console.error(err) + process.exit(1) }