-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.js
More file actions
28 lines (23 loc) · 800 Bytes
/
start.js
File metadata and controls
28 lines (23 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// you *have to* specify <foo>
// you *can* specify [bar]
exports.command = 'start <foo> [bar]';
exports.desc = 'This is the start command';
exports.builder = yargs => {
// valid option keys: https://yargs.js.org/docs/#api-optionskey-opt
yargs.options({
force: {
alias: ['f', 'ff'], // or just 'a' if only one
describe: 'Description for force options',
default: false,
type: 'boolean',
// demand: true
},
});
yargs
.example(`$0 start foo`, `This is an example of how to use this command`)
.example(`$0 start foo bar`, `This is another example of how to use this command`);
};
exports.handler = async argv => {
const { foo, bar, force } = argv;
console.log({foo, bar, force});
};