From 12811fff1a6c4e12fb9dcd5fb7051db34da3ea6a Mon Sep 17 00:00:00 2001 From: Alexzhu Date: Fri, 12 Jun 2026 09:09:26 +0800 Subject: [PATCH] fix(scripts): add --help to test-channel-receive (#3543) Co-authored-by: alexzhu0 --- scripts/test-channel-receive.mjs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/test-channel-receive.mjs b/scripts/test-channel-receive.mjs index f0c0e9c22..6c5046af4 100755 --- a/scripts/test-channel-receive.mjs +++ b/scripts/test-channel-receive.mjs @@ -20,7 +20,26 @@ import { fileURLToPath } from 'url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const ROOT = path.resolve(__dirname, '..'); +function usage() { + return [ + 'Usage: node scripts/test-channel-receive.mjs [options]', + '', + 'Connects to the backend Socket.IO server, authenticates with the stored', + 'session JWT, and listens for incoming channel messages.', + '', + 'Options:', + ' --timeout N Wait N seconds before timing out (default: 60).', + ' --debug Enable verbose logging.', + ' --send-test Also send a test message after connecting.', + ' -h, --help Show this help and exit.', + ].join('\n'); +} + const args = process.argv.slice(2); +if (args.includes('--help') || args.includes('-h')) { + console.log(usage()); + process.exit(0); +} const DEBUG = args.includes('--debug'); const SEND_TEST = args.includes('--send-test');