-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.js
36 lines (31 loc) · 891 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
#!/usr/bin/env node
const program = require('commander');
const { chapters, read, info, search } = require('./app.js');
program
.version('1.0.0')
.command('chapters')
.alias('c')
.description('Lists all chapters of the Holy Quran')
.action(chapters);
program
.command('info <chapter>')
.alias('i')
.description('Gets chapter information')
.action((chapter) => {
info(chapter);
});
program
.command('read <chapter> [verse] [arabic]')
.alias('r')
.description('Lists details about provided chapter and verse')
.action((chapter, verse, arabic) => {
read(chapter, verse, arabic);
});
program
.command('search <keyword> [arabic]')
.alias('s')
.description('Search for given text from translation.')
.action((keyword, arabic) => {
search(keyword, arabic);
});
program.parse(process.argv);