"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:
parent
7a43503c52
commit
a65ca4e37f
|
@ -4,6 +4,7 @@ const {spawn} = require("child_process");
|
||||||
const yargs = Yargs(process.argv.splice(2))
|
const yargs = Yargs(process.argv.splice(2))
|
||||||
.scriptName('kr')
|
.scriptName('kr')
|
||||||
.usage('kr [args] <process-to-run>')
|
.usage('kr [args] <process-to-run>')
|
||||||
|
.help()
|
||||||
.option('_rpm', {
|
.option('_rpm', {
|
||||||
default: 0,
|
default: 0,
|
||||||
description: 'The amount of Retries Per Minute, before we stop retrying',
|
description: 'The amount of Retries Per Minute, before we stop retrying',
|
||||||
|
@ -20,7 +21,6 @@ const yargs = Yargs(process.argv.splice(2))
|
||||||
type: 'number'
|
type: 'number'
|
||||||
})
|
})
|
||||||
.conflicts('_rpm', '_rph')
|
.conflicts('_rpm', '_rph')
|
||||||
.help();
|
|
||||||
|
|
||||||
const { _ = [], _rpm: rpm, _rph: rph, _delay: delay } = yargs.argv;
|
const { _ = [], _rpm: rpm, _rph: rph, _delay: delay } = yargs.argv;
|
||||||
const [command, ...args ] = _;
|
const [command, ...args ] = _;
|
||||||
|
|
Loading…
Reference in New Issue