From ecb04b195f33fb8d2f39c6f4e2add1c00ae7fc74 Mon Sep 17 00:00:00 2001 From: iMaverick007 Date: Thu, 26 Mar 2026 11:29:32 +0530 Subject: [PATCH] Improve unknown option error to display all invalid flags --- bin/express-cli.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/express-cli.js b/bin/express-cli.js index 380a447d..e5db0e9f 100755 --- a/bin/express-cli.js +++ b/bin/express-cli.js @@ -417,7 +417,14 @@ function main (options, done) { // top-level argument direction if (options['!'].length > 0) { usage() - error('unknown option `' + options['!'][0] + "'") + + var unknownOptions = options['!'] + .map(function (opt) { + return '`' + opt + '`' + }) + .join(', ') + + error('unknown option' + (options['!'].length > 1 ? 's ' : ' ') + unknownOptions) done(1) } else if (args.help) { usage()