-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcli.js
executable file
·99 lines (74 loc) · 2.14 KB
/
cli.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/env node
const cmd = process.argv[2]
async function index () {
switch (cmd) {
case 'init':
case 'i':
require('./src/cmd/init')
return
case 'status':
case 's':
require('./src/cmd/status')
return
case 'feed':
case 'f':
require('./src/cmd/feed')
return
case 'expand':
case 'e':
require('./src/cmd/expand')
return
case 'collect':
case 'c':
require('./src/cmd/collect')
return
case 'add':
case 'a':
require('./src/cmd/add')
return
case 'browse':
case 'b':
require('./src/cmd/browse')
return
case 'inspect':
require('./src/cmd/inspect')
return
case 'ls':
case 'list':
require('./src/cmd/list')
return
case 'show':
require('./src/cmd/show')
return
case '--help':
case 'help':
case undefined:
console.log(`Usage: lit <command>
lit init Initialize new review in current dir.
lit status Show information about current lit review.
lit feed [file] Feed current review with phrase sets.
[file] JSON formatted list of list of strings.
lit expand Expand phrase sets into queries.
lit collect [<flags>] Execute queries and collect results.
--limit=N Number of queries to execute.
lit add <tags> Add tags to list of available tags.
<tag> Tags to add. Separate with spaces.
lit browse [<flags>] Browse and tag documents.
--tag Tag mode.
--save Save changes whenever prompted.
--untagged Only untagged.
--tagged Only tagged.
--only=<tag> Matching tag.
--skip=<tag> Not matching tag.
lit list [<flags>] Print list of documents to standard out. Alias: 'ls'.
--untagged Only untagged.
--tagged Only tagged.
--only=<tag> Matching tag.
--skip=<tag> Not matching tag.
lit show <id> Show document with id.`)
return
default:
console.log(`lit: '${cmd}' is not a command. See 'lit --help'`)
}
}
index()