Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Commit

Permalink
added tags and other changes regarding file:write()
Browse files Browse the repository at this point in the history
  • Loading branch information
jasjs1 authored Mar 12, 2023
1 parent 32f5735 commit 3cbebbf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .app/todoList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ local function addTask()
local priority = io.read("*line")
if priority == "" then priority = nil end

io.write("Lables: ")
local lables = io.read()

io.write("Subtasks (separated by commas): ")
local subtasksStr = io.read("*line")
local subtasks = {}
Expand All @@ -33,14 +36,18 @@ local function addTask()

local file = io.open("taskList.txt", "a")

file:write("\n")
file:write("-------New Task -----" .. "\n")
file:write("Task name: " .. task .. "\n")
file:write("Due date: " .. (dueDate or "") .. "\n")
file:write("Priority: " .. (priority or "") .. "\n")
file:write("Lables: " .. lables .. "\n")
file:write("Sub tasks: " .. (subtasksStr or "") .. "\n")
file:write("Date added: " .. os.date('%m-%d-%Y %H:%M:%S') .. "\n")
file:write("\n")

file:close()
print("") -- spacer
print("Task added! Check the explorer for: taskList.txt")
end

Expand Down

0 comments on commit 3cbebbf

Please sign in to comment.