-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·62 lines (56 loc) · 1.12 KB
/
cli.js
File metadata and controls
executable file
·62 lines (56 loc) · 1.12 KB
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
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const updateNotifier = require('update-notifier');
const pkg = require('./package.json');
const taskss = require('.');
const notifier = updateNotifier({ pkg });
notifier.notify();
const cli = meow(
`
Usage
$ taskss <options>
Options
--new, -n add a new task
--edit, -e edit a task
--delete, -d delete a task
--task, -t add a new task with the given title
--group, -g group of the task being added by --task
Examples
$ taskss # opens in list mode
$ taskss -e 1 # opens in edit mode to edit 1st task
$ taskss --new # add new task
$ taskss -t "fix #10" -g coding # short way to add a task
`,
{
flags: {
new: {
type: 'boolean',
alias: 'n'
},
edit: {
type: 'integer',
alias: 'e'
},
delete: {
type: 'integer',
alias: 'd'
},
task: {
type: 'string',
alias: 't'
},
group: {
type: 'string',
alias: 'g'
}
}
}
);
if (notifier.update) {
setTimeout(() => {
taskss(cli.input[0], cli.flags);
}, 3000);
} else {
taskss(cli.input[0], cli.flags);
}