From 0d2481ed8abdb084f5c10984181c2a7355d5208a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 12 Apr 2026 12:14:23 -0300 Subject: upd8, etc: curated url validation, tidying modes, --format-urls --- src/cli.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/cli.js') 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; -- cgit 1.3.0-6-gf8a5