-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.js
More file actions
36 lines (27 loc) · 742 Bytes
/
index.js
File metadata and controls
36 lines (27 loc) · 742 Bytes
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
import addTask from "./commands/addTask.js";
import updateTask from "./commands/updateTask.js";
import deleteTask from "./commands/deleteTask.js";
import readTask from "./commands/readTask.js";
import { Command } from 'commander'
const program = new Command()
program
.name('todo')
.description('Your terminal task manager!')
.version('1.0.0')
program
.command('add')
.description('Create a new todo.')
.action(addTask)
program
.command('read')
.description('Reads all the todos.')
.action(readTask)
program
.command('update')
.description('Updates a todo.')
.action(updateTask)
program
.command('delete')
.description('Deletes a todo.')
.action(deleteTask)
program.parse()