forked from IvanFrescas/MiniLedger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
51 lines (38 loc) · 994 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
46
47
48
49
const program = require('commander');
program.version('0.0.1');
// Commands
program
.command('register <args>')
.alias('reg')
.description('List all postings matching the report-query. ')
.action(() => {
console.log('register')
})
program
.command('balance <args>')
.alias('bal')
.description('Print a balance report showing totals for postings that match report-query, and aggregate totals for parents of those accounts')
.action(function (file) {
const Balance = require("./Balance");
Balance(file)
})
program
.command('print')
.alias('p')
.description('Print out the full transactions of any matching postings')
.action(() => {
console.log('print')
})
// Options
program
.option('--price-db' ,'')
.action()
program
.option('--file [path] ' ,'Read journal data from FILE.')
.action()
program
.option('-s, --sort' ,'Sort postings by evaluating the given value-expression')
.action((nombre) => {
console.log(`Hola ${nombre}`)
})
program.parse(process.argv);