Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Akash Manohar J <akash@akash.im>
- Loading branch information
Showing
6 changed files
with
40 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /usr/bin/env ruby | ||
require 'rainbow' | ||
require File.expand_path('../lib/j', File.dirname(__FILE__)) | ||
|
||
|
||
j = J.new | ||
|
||
if ARGV.count == 0 | ||
j.listTasks | ||
elsif ARGV.count == 1 | ||
j.listTasks(:done) if ARGV[0] == "-d" | ||
j.listTasks(:all) if ARGV[0] == "-a" | ||
j.clearList if ARGV[0]=="-c" | ||
elsif ARGV.count == 2 and ARGV.first == "-m" | ||
j.markTask ARGV[1] | ||
elsif ARGV.count == 2 and ARGV.first == "-r" | ||
j.deleteTask ARGV[1] | ||
else | ||
j.addTask ARGV.join(" ") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
HowItWorks | ||
--------------- | ||
|
||
Checks for a .t.list file in $HOME | ||
Checks for a .todo file in $HOME | ||
if not present create it | ||
|
||
* list (todo) tasks (t) | ||
* list (todo) tasks (j) | ||
get the contents of the file by line and push to an array | ||
and print each todo task in the format: <key> | <status> | <task> | ||
Option -a to list all tasks | ||
Option -b to list done tasks only | ||
Option -d to list done tasks only | ||
|
||
* create task (t <string>) | ||
* create task (j <string>) | ||
just append the new task to the file in this format | ||
<key> | <status> | <task> | ||
|
||
* Mark as done (t -m <key>) | ||
* Mark as done (j -m <key>) | ||
find dump tasks to array, delete that particular task and write back | ||
show message. Else show error | ||
|
||
* clear list (t -c) | ||
* clear list (j -c) | ||
delete the .t.list file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters