diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-04-12 12:14:23 -0300 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-04-12 12:15:04 -0300 |
| commit | 0d2481ed8abdb084f5c10984181c2a7355d5208a (patch) | |
| tree | f039a8ef4def20bb8ac9202bdc85a94dfaec3dbb /src/cli.js | |
| parent | 5fcd8ce38402c6623b57a5dc846c9786a24644f1 (diff) | |
upd8, etc: curated url validation, tidying modes, --format-urls
Diffstat (limited to 'src/cli.js')
| -rw-r--r-- | src/cli.js | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/cli.js b/src/cli.js index ec72a625..52ac9f9c 100644 --- a/src/cli.js +++ b/src/cli.js @@ -231,18 +231,29 @@ export function showHelpForOptions({ options, indentWrap, sort = entries => entries, + silentIfNoOptions = false, }) { - if (heading) { - console.log(colors.bright(heading)); - } - const sortedOptions = sort( Object.entries(options) .map(([name, descriptor]) => ({name, descriptor}))); + if (!sortedOptions.length && silentIfNoOptions) return; + + if (heading) { + console.log(colors.bright(heading)); + } + if (!sortedOptions.length) { - console.log(`(No options available)`) + if (heading) { + console.log(``); + console.log(` (No options available)`); + console.log(``); + } else { + console.log(`(No options available)`); + } + + return; } let justInsertedPaddingLine = false; |