"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.
This commit is contained in:
Ian Wijma 2023-11-19 15:40:19 +11:00
parent 7a43503c52
commit a65ca4e37f
1 changed files with 1 additions and 1 deletions

View File

@ -4,6 +4,7 @@ const {spawn} = require("child_process");
const yargs = Yargs(process.argv.splice(2))
.scriptName('kr')
.usage('kr [args] <process-to-run>')
.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 ] = _;