Skip to content

Commit

Permalink
#208 Added yargs command and options for executing run command
Browse files Browse the repository at this point in the history
  • Loading branch information
czprz committed May 18, 2023
1 parent cda50cd commit fa4f3d1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions bin/execution/executor/executor-yargs-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,36 @@ export default new class {
this.#execute(segment, project, argv).catch(console.error);
}
})
.command({
command: 'run [name]',
desc: 'Run action continuously',
builder: (yargs) => {
yargs
.positional('name', {
describe: 'Name of the action',
type: 'string',
demandOption: true
})
.option('times', {
alias: 't',
describe: 'Number of times to run action (0 - infinite)',
type: 'number',
default: 0
})
.option('interval', {
alias: 'i',
describe: 'Interval between runs (seconds)',
type: 'number',
demandOption: true
});

customOptionsYargsCreator.addToYargs(yargs, segment.actions)
},
handler: (argv) => {
// TODO: Implement
this.#execute(segment, project, argv).catch(console.error);
}
})
.command({
command: 'down [name]',
desc: 'Take down actions',
Expand Down

0 comments on commit fa4f3d1

Please sign in to comment.