todo

Source ยป

Todo is a list management tool. It allows for appending, deleting, editing, and viewing your list in a variety of ways. Operation is done through line numbers and standard input or through command line flags.

todo.go

Example

First you have to initialize an empty list.

$ ls -l
total 0
$ todo init todo.json
$ ls
todo.json

When appending, if you don't specify any flags, it will read through standard input.

$ todo append todo.json
Message: First todo item!
Details (reads until 'END'):
This can take multiple lines of input.
And will only be shown with {view} if you specify -v.
END
Category: programming
Priority: 2

Now, if we view our list, you will see the item has been added.

$ todo view todo.json
ID | Message          | Category    | Priority
-- ---------          ----------    ----------
1  | First todo item! | programming | 2
$ todo -v view todo.json
ID | Message          | Details                                                                                       | Category    | Priority
-- ---------          ---------                                                                                       ----------    ----------
1  | First todo item! | This can take multiple lines of input.\nAnd will only be shown with {view} if you specify -v. | programming | 2

But viewing the details isn't very pretty, especially because of the newlines. Instead lets view that particular item in a nicer way.

$ todo -v -n 1 view todo.json
ID        : 1
Message   : First todo item!
Details   : This can take multiple lines of input.
          | And will only be shown with {view} if you specify -v.
Category  : programming
Priority  : 2
$ todo -n 1 edit todo.json
ID        : 1
Message   : First todo item!
Details   : This can take multiple lines of input.
          | And will only be shown with {view} if you specify -v.
Category  : programming
Priority  : 2
Are you sure you want to overwrite this item? [y/N]: y
Message: New and improved todo item.
Details (reads until 'END'):
Just a short message.
END
Category: programming
Priority: 3
$ todo -n 1 delete todo.json
ID        : 1
Message   : New and improved todo item.
Details   : Just a short message.
Category  : programming
Priority  : 3
Are you sure you want to delete this item? [y/N]: y