Skip to content

Commit 3b18d01

Browse files
authored
Merge pull request #15 from shahriaarrr/develop/menu
add main menu for tasky
2 parents 87a45b4 + ea26ddf commit 3b18d01

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

cli/tasky/main.go

+34
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ func main() {
2323
edit := flag.Bool("edit", false, "edit your task")
2424
flag.Parse()
2525

26+
// Display the welcome menu if no commands are provided
27+
if len(os.Args) == 1 {
28+
displayMenu()
29+
return
30+
}
31+
2632
tasks := &tasky.Todos{}
2733

2834
// Load tasks from file
@@ -86,6 +92,34 @@ func main() {
8692
}
8793
}
8894

95+
// displayMenu displays the welcome message and available commands
96+
func displayMenu() {
97+
menu := `
98+
████████╗ █████╗ ███████╗██╗ ██╗██╗ ██╗
99+
╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝╚██╗ ██╔╝
100+
██║ ███████║███████╗█████╔╝ ╚████╔╝
101+
██║ ██╔══██║╚════██║██╔═██╗ ╚██╔╝
102+
██║ ██║ ██║███████║██║ ██╗ ██║
103+
╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝
104+
105+
Welcome to Tasky👋
106+
Your personal command-line task manager🧑‍💼
107+
108+
Tasky helps you efficiently manage your to-do list directly from the terminal.
109+
Whether you're tracking daily tasks, marking items as complete, or editing existing tasks,
110+
Tasky provides a simple yet powerful interface to keep your tasks organized.
111+
112+
You can see Available commands with -h command.
113+
114+
Stay on top of your tasks with Tasky!
115+
116+
for more details: https://github.com/shahriaarrr/Tasky
117+
118+
© Developed with ❤️ and ☕ By Shahriar Ghasempour.
119+
`
120+
fmt.Println(menu)
121+
}
122+
89123
func getInput(r io.Reader, args ...string) (string, error) {
90124
if len(args) > 0 {
91125
return strings.Join(args, " "), nil

0 commit comments

Comments
 (0)