my-first-golang-cli-app

command module
v0.0.0-...-4b58b44 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2022 License: MIT Imports: 2 Imported by: 0

README

my-first-golang-cli-app

A CLI app for managing a to-do list, based on sqlite and cobra.

How to develop

  • go build main.go builds the application and creates a new binary file.
  • ./main runs the application

Data structure

type Todo struct {
	Id                       int
	Name, Description, Tasks string
}

Each todo entry on the database consist of name, description and tasks fields of string type. tasks field represents an array of strings, seperated with pipe operator.

Commands & usage

Local database needs to be initialized upon first use. To this end, please run init command.

  • init initializes a database in the same folder (sqlite-database.db)
  • todo list lists todos
  • todo new prompts an interactive user interface, for getting the details of a todo entry.
  • todo get [todo_id] gets a todo with the given id
  • todo update [todo_id] updates a todo with the given id
  • todo add-task [todo_id] [task] adds a task to the todo with the given id
  • todo remove-task [todo_id] [task] removes a task from the todo with the given id
  • todo delete [todo_id] deletes a todo with the given id

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL