-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
45 lines (38 loc) · 957 Bytes
/
index.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env node
const { program } = require('commander');
const {
setWelcomeMessage,
addRec,
showRec,
deleteRec,
updateRec,
} = require('./helpers/commandFunctions');
// setting meta data
program.version('0.0.1').description('CLI password management tool');
setWelcomeMessage();
program
.command('add')
.alias('a')
.description('Add a new record')
.action(addRec);
program
.command('show <scope>')
.alias('s')
.description('Show records')
.action((scope) => showRec(scope));
program
.command('delete <id>')
.alias('d')
.description('Delete a record')
.action((id) => deleteRec(id));
program
.command('update <id> <field> <value>')
.alias('u')
.description('Delete a record')
.action((id, field, value) => updateRec(id, field, value));
// program
// .command('init')
// .alias('i')
// .description('Initialize passchase')
// .action(() => init());
program.parse(process.argv);