I'm trying to implement a restart
command using yargs. I already implemented the start
and stop
commands and all I want to do now, is call these existing commands inside the restart
command.
Unfortunately it does not work by simply using yargs.parse('stop');
yargs.command('start', '', () => {}, (argv) => {
console.log('Starting');
});
yargs.command('stop', '', () => {}, (argv) => {
console.log('Stopping');
});
yargs.command('restart', 'description', () => {}, (argv) => {
yargs.parse('stop');
yargs.parse('start');
});
I also couldn't find anything related in the Github issues or the API documentation. What am I missing?
Thank you!