-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
45 lines (29 loc) · 998 Bytes
/
main.ts
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
'use strict';
import { Task } from './Task';
import { List } from './List';
const fs = require('fs');
let fileContent = fs.readFileSync('tasks.txt', 'utf-8');
let taskArray = fileContent.split('\r\n')
let tasksList = new List();
let tasks: Task[] = initializeTask();
function initializeTask(): Task[] {
let newArrey = [];
for ( let i = 0; i < taskArray.length; i++){
newArrey.push(new Task (taskArray[i]))
}
return newArrey;
}
console.log(taskArray.length)
console.log(tasks)
// for (let i = 0; i < listOfTasks.length ; i++) {
// todoList.add(listOfTasks[i])
// }
// list.printAll();
// console.log(list.getTasks()[2].getName())
// console.log(process.argv);
// if(process.argv[2] === '-l') {
// console.log(
// );
// } else {
// console.log(`$ todo \r\nCommand Line Todo applicaton\r\n=============================\r\n\r\nCommand line arguments:\r\n-l Lists all the tasks\r\n-a Adds a new task\r\n-r Removes an task\r\n-c Completes an task`);
// }