diff --git a/cli/src/index.ts b/cli/src/index.ts index 15e35b7be..2bc37d3de 100755 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -44,22 +44,22 @@ export class Commander { .option('-h, --hostname ', 'the broker host', 'localhost') .option('-p, --port ', 'the broker port', parseNumber) .option('-i, --client-id ', 'the client id', getClientId()) - .option('--no-clean', 'set the clean session flag to false (default: true)') + .option('--no-clean', 'set the clean session flag to false', true) .option('-k, --keepalive ', 'send a ping every SEC seconds', parseNumber, 30) .option('-u, --username ', 'the username') .option('-P, --password ', 'the password') - .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts (default: mqtt)', parseProtocol) + .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts', parseProtocol, 'mqtt') .option('--key ', 'path to the key file') .option('--cert ', 'path to the cert file') .option('--ca ', 'path to the ca certificate') .option('--insecure', 'do not verify the server certificate') .option( '-rp, --reconnect-period ', - 'interval between two reconnections, disable auto reconnect by setting to 0 (default: 1000ms)', + 'interval between two reconnections, disable auto reconnect by setting to 0', parseNumber, 1000, ) - .option('--maximun-reconnect-times ', 'the maximum reconnect times (default: 10)', parseNumber, 10) + .option('--maximun-reconnect-times ', 'the maximum reconnect times', parseNumber, 10) // properties options of MQTT 5.0 .option('-se, --session-expiry-interval ', 'the session expiry interval in seconds', parseNumber) .option('--rcv-max, --receive-maximum ', 'the receive maximum value', parseNumber) @@ -126,22 +126,22 @@ export class Commander { .option('-h, --hostname ', 'the broker host', 'localhost') .option('-p, --port ', 'the broker port', parseNumber) .option('-i, --client-id ', 'the client id', getClientId()) - .option('--no-clean', 'set the clean session flag to false (default: true)') + .option('--no-clean', 'set the clean session flag to false', true) .option('-k, --keepalive ', 'send a ping every SEC seconds', parseNumber, 30) .option('-u, --username ', 'the username') .option('-P, --password ', 'the password') - .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts (default: mqtt)', parseProtocol) + .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts', parseProtocol, 'mqtt') .option('--key ', 'path to the key file') .option('--cert ', 'path to the cert file') .option('--ca ', 'path to the ca certificate') .option('--insecure', 'do not verify the server certificate') .option( '-rp, --reconnect-period ', - 'interval between two reconnections, disable auto reconnect by setting to 0 (default: 1000ms)', + 'interval between two reconnections, disable auto reconnect by setting to 0', parseNumber, 1000, ) - .option('--maximun-reconnect-times ', 'the maximum reconnect times (default: 10)', parseNumber, 10) + .option('--maximun-reconnect-times ', 'the maximum reconnect times', parseNumber, 10) // connect properties options of MQTT 5.0 .option('-se, --session-expiry-interval ', 'the session expiry interval in seconds', parseNumber) .option('--rcv-max, --receive-maximum ', 'the receive maximum value', parseNumber) @@ -198,22 +198,22 @@ export class Commander { .option('-h, --hostname ', 'the broker host', 'localhost') .option('-p, --port ', 'the broker port', parseNumber) .option('-i, --client-id ', 'the client id', getClientId()) - .option('--no-clean', 'set the clean session flag to false (default: true)') + .option('--no-clean', 'set the clean session flag to false', true) .option('-u, --username ', 'the username') .option('-P, --password ', 'the password') - .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts (default: mqtt)', parseProtocol) + .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts', parseProtocol, 'mqtt') .option('--key ', 'path to the key file') .option('--cert ', 'path to the cert file') .option('--ca ', 'path to the ca certificate') .option('--insecure', 'do not verify the server certificate') .option( '-rp, --reconnect-period ', - 'interval between two reconnections, disable auto reconnect by setting to 0 (default: 1000ms)', + 'interval between two reconnections, disable auto reconnect by setting to 0', parseNumber, 1000, ) - .option('--maximun-reconnect-times ', 'the maximum reconnect times (default: 10)', parseNumber, 10) + .option('--maximun-reconnect-times ', 'the maximum reconnect times', parseNumber, 10) // connect properties options of MQTT 5.0 .option('-se, --session-expiry-interval ', 'the session expiry interval in seconds', parseNumber) .option('--rcv-max, --receive-maximum ', 'the receive maximum value', parseNumber) @@ -251,27 +251,27 @@ export class Commander { .command('conn') .description('Create a custom number of connections.') .option('-c, --count ', 'the number of connections', parseNumber, 1000) - .option('-i, --interval ', 'interval of connecting to the broker (default: 10ms)', parseNumber, 10) + .option('-i, --interval ', 'interval of connecting to the broker', parseNumber, 10) .option('-V, --mqtt-version <5/3.1.1/3.1>', 'the MQTT version', parseMQTTVersion, 5) .option('-h, --hostname ', 'the broker host', 'localhost') .option('-p, --port ', 'the broker port', parseNumber) .option('-I, --client-id ', 'the client id, support %i (index) variable', getClientId()) - .option('--no-clean', 'set the clean session flag to false (default: true)') + .option('--no-clean', 'set the clean session flag to false', true) .option('-k, --keepalive ', 'send a ping every SEC seconds', parseNumber, 30) .option('-u, --username ', 'the username') .option('-P, --password ', 'the password') - .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts (default: mqtt)', parseProtocol) + .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts', parseProtocol, 'mqtt') .option('--key ', 'path to the key file') .option('--cert ', 'path to the cert file') .option('--ca ', 'path to the ca certificate') .option('--insecure', 'do not verify the server certificate') .option( '-rp, --reconnect-period ', - 'interval between two reconnections, disable auto reconnect by setting to 0 (default: 1000ms)', + 'interval between two reconnections, disable auto reconnect by setting to 0', parseNumber, 1000, ) - .option('--maximun-reconnect-times ', 'the maximum reconnect times (default: 10)', parseNumber, 10) + .option('--maximun-reconnect-times ', 'the maximum reconnect times', parseNumber, 10) // properties options of MQTT 5.0 .option('-se, --session-expiry-interval ', 'the session expiry interval in seconds', parseNumber) .option('--rcv-max, --receive-maximum ', 'the receive maximum value', parseNumber) @@ -307,13 +307,8 @@ export class Commander { .command('pub') .description('Publish a custom number of messages at a custom rate.') .option('-c, --count ', 'the number of connections', parseNumber, 1000) - .option('-i, --interval ', 'interval of connecting to the broker (default: 10ms)', parseNumber, 10) - .option( - '-im, --message-interval ', - 'interval of publishing messages (default: 1000ms)', - parseNumber, - 1000, - ) + .option('-i, --interval ', 'interval of connecting to the broker', parseNumber, 10) + .option('-im, --message-interval ', 'interval of publishing messages', parseNumber, 1000) .requiredOption( '-t, --topic ', 'the message topic, support %u (username), %c (client id), %i (index) variables', @@ -349,22 +344,22 @@ export class Commander { .option('-h, --hostname ', 'the broker host', 'localhost') .option('-p, --port ', 'the broker port', parseNumber) .option('-I, --client-id ', 'the client id, support %i (index) variable', getClientId()) - .option('--no-clean', 'set the clean session flag to false (default: true)') + .option('--no-clean', 'set the clean session flag to false', true) .option('-k, --keepalive ', 'send a ping every SEC seconds', parseNumber, 30) .option('-u, --username ', 'the username') .option('-P, --password ', 'the password') - .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts (default: mqtt)', parseProtocol) + .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts', parseProtocol, 'mqtt') .option('--key ', 'path to the key file') .option('--cert ', 'path to the cert file') .option('--ca ', 'path to the ca certificate') .option('--insecure', 'do not verify the server certificate') .option( '-rp, --reconnect-period ', - 'interval between two reconnections, disable auto reconnect by setting to 0 (default: 1000ms)', + 'interval between two reconnections, disable auto reconnect by setting to 0', parseNumber, 1000, ) - .option('--maximun-reconnect-times ', 'the maximum reconnect times (default: 10)', parseNumber, 10) + .option('--maximun-reconnect-times ', 'the maximum reconnect times', parseNumber, 10) // connect properties options of MQTT 5.0 .option('-se, --session-expiry-interval ', 'the session expiry interval in seconds', parseNumber) .option('--rcv-max, --receive-maximum ', 'the receive maximum value', parseNumber) @@ -400,7 +395,7 @@ export class Commander { .command('sub') .description('Create a custom number of connections then subscribe to one or multiple topics.') .option('-c, --count ', 'the number of connections', parseNumber, 1000) - .option('-i, --interval ', 'interval of connecting to the broker (default: 10ms)', parseNumber, 10) + .option('-i, --interval ', 'interval of connecting to the broker', parseNumber, 10) .requiredOption( '-t, --topic ', 'the message topic, support %u (username), %c (client id), %i (index) variables', @@ -426,22 +421,22 @@ export class Commander { .option('-h, --hostname ', 'the broker host', 'localhost') .option('-p, --port ', 'the broker port', parseNumber) .option('-I, --client-id ', 'the client id, support %i (index) variable', getClientId()) - .option('--no-clean', 'set the clean session flag to false (default: true)') + .option('--no-clean', 'set the clean session flag to false', true) .option('-u, --username ', 'the username') .option('-P, --password ', 'the password') - .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts (default: mqtt)', parseProtocol) + .option('-l, --protocol ', 'the protocol to use, mqtt or mqtts', parseProtocol, 'mqtt') .option('--key ', 'path to the key file') .option('--cert ', 'path to the cert file') .option('--ca ', 'path to the ca certificate') .option('--insecure', 'do not verify the server certificate') .option( '-rp, --reconnect-period ', - 'interval between two reconnections, disable auto reconnect by setting to 0 (default: 1000ms)', + 'interval between two reconnections, disable auto reconnect by setting to 0', parseNumber, 1000, ) - .option('--maximun-reconnect-times ', 'the maximum reconnect times (default: 10)', parseNumber, 10) + .option('--maximun-reconnect-times ', 'the maximum reconnect times', parseNumber, 10) // connect properties options of MQTT 5.0 .option('-se, --session-expiry-interval ', 'the session expiry interval in seconds', parseNumber) .option('--rcv-max, --receive-maximum ', 'the receive maximum value', parseNumber)