From a65ca4e37fb23d12ec36a13e2b0e084fcec938ab Mon Sep 17 00:00:00 2001 From: Ian Wijma Date: Sun, 19 Nov 2023 15:40:19 +1100 Subject: [PATCH] "Added .help() method in the command configuration" In this commit, the .help() method was moved to an earlier part of the command configuration. Previously, .help() was executed after defining options. The reason for this change was to improve code readability and ensure that the help command is processed in line with other commands, improving user experience by offering immediate assistance for all commands. This effective placement of .help() method should make it easier for users to understand how to interact with the command line interface. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 0f06fdd..f3fef06 100644 --- a/src/index.js +++ b/src/index.js @@ -4,6 +4,7 @@ const {spawn} = require("child_process"); const yargs = Yargs(process.argv.splice(2)) .scriptName('kr') .usage('kr [args] ') + .help() .option('_rpm', { default: 0, description: 'The amount of Retries Per Minute, before we stop retrying', @@ -20,7 +21,6 @@ const yargs = Yargs(process.argv.splice(2)) type: 'number' }) .conflicts('_rpm', '_rph') - .help(); const { _ = [], _rpm: rpm, _rph: rph, _delay: delay } = yargs.argv; const [command, ...args ] = _;