-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
39 lines (28 loc) · 854 Bytes
/
main.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
#!/usr/bin/env node
let inputArr = process.argv.slice(2);
const { count } = require("console");
// console.log(inputArr);
let fs = require("fs");
const { type } = require("os");
let path = require("path");
const { helpkey } = require("./commands/help");
let helpObject = require("./commands/help");
let treeObject = require("./commands/tree");
let organizeObject = require("./commands/organize");
// node main.js tree "directoryPath"
// node main.js organize "directoryPath"
// node main.js help
let command = inputArr[0];
switch (command) {
case "tree":
treeObject.treeKey(inputArr[1]);
break;
case "organize":
organizeObject.organizeKey(inputArr[1]);
break;
case "help":
helpObject.helpkey(inputArr[1]);
break;
default:
console.log("Please🙏 Input Right command");
}