-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
29 lines (27 loc) · 740 Bytes
/
Copy pathapp.js
File metadata and controls
29 lines (27 loc) · 740 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
const yargs = require("yargs")
const fileOperations = require("./fileOperations")
const operationDetail = yargs.argv
const operation = operationDetail._[0]
fileOperations.checkFileStatus()
switch (operation) {
case "list":
fileOperations.list(true)
break;
case "write":
fileOperations.write(operationDetail)
break;
case "show":
fileOperations.show(operationDetail)
break;
case "remove-one":
fileOperations.removeOne(operationDetail)
break;
case "remove-all":
fileOperations.removeAll()
break;
case "update":
fileOperations.update(operationDetail)
break;
default:
fileOperations.errorOperation(operation)
}