Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

todo-list

Perfect! Let’s make your README look professional, visually clean, and GitHub-ready. I’ll add tables, clear sections, and a roadmap so anyone can read and implement enhancements easily.

Here’s the upgraded version:


📝 CLI To-Do List Application

A simple command-line To-Do List application written in Go. Manage your tasks directly from the terminal with ease — add, list, start, complete, and delete tasks. Uses enums for Priority and Status to keep tasks structured and readable.


📌 Features

Feature Description
Add Task add <description> [-p priority] → Add a new task with optional priority (low, medium, high)
List Tasks list [status] → Show all tasks or filter by status (pending, started, completed)
Start Task start <task-id> → Mark a task as started
Complete Task done <task-id> → Mark a task as completed
Delete Task delete <task-id> → Remove a task from the list
Automatic ID Each task is assigned a unique ID automatically

💻 Usage

Run the program and enter commands in the terminal:

> add Buy groceries -p high
Task added! ID: 1 | Buy groceries | High

> list pending
ID    Status     Priority   Description
1     Pending    High       Buy groceries

> start 1
Task 1 marked as Started.

> done 1
Task 1 marked as Completed.

> delete 1
Task 1 deleted successfully.

> exit
Goodbye!

🔹 Suggested Enhancements (To Implement)

These functions can be added to improve maintainability and features:

Function Description
findTaskByID(tasks []Task, id int) (int, *Task) Search for a task by ID and return a reference for easy updates (used in start, done, delete)
listTasks(tasks []Task, filter string) Move task listing logic into a function with optional status filtering
updateTask(tasks *[]Task, id int, newDescription string, newPriority Priority) Edit a task’s description or priority after creation
clearCompleted(tasks *[]Task) Remove all tasks marked as Completed from the list
showHelp() Display all available commands and usage instructions
Persistence Implement saveTasksToFile(filename string) and loadTasksFromFile(filename string) using JSON to retain tasks between sessions

🚀 Roadmap / Next Steps

  1. Refactor your CLI using helper functions like findTaskByID and listTasks for cleaner code.
  2. Implement updateTask to allow editing task descriptions and priorities.
  3. Add clearCompleted to clean up completed tasks in bulk.
  4. Implement file persistence to save and load tasks between sessions.
  5. Enhance CLI with priority filtering in the list command.
  6. Add a help command to make the tool user-friendly for beginners.

📫 Contributing / Submission

If you implement the suggested enhancements:

  • Test your code thoroughly for edge cases (invalid IDs, empty task list, missing arguments).
  • Share your updated code by sending it to:
m.arshad.baloch2004@gmail.com

⚡ Notes

  • The project is fully in-memory, so tasks are lost when the program exits unless file persistence is added.
  • Priority defaults to Medium if not specified.
  • Status transitions: Pending → Started → Completed.

About

A basic To-Do List (CLI) – Manage tasks (add, list, delete) with a JSON file or memory is don't know yet.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages