Compare commits
3 Commits
7a9d7e9ff0
...
e8e73da981
Author | SHA1 | Date | |
---|---|---|---|
e8e73da981 | |||
ad41fe3fbf | |||
0113cec73c |
40
README.md
40
README.md
@ -1,3 +1,41 @@
|
||||
# dodo
|
||||
|
||||
A kanban style task manager with task status descriptions.
|
||||
A kanban style task manager with task specific log entries.
|
||||
|
||||
## commands
|
||||
|
||||
##### `dodo` or `dodo view <project tag>`
|
||||
|
||||
Displays kanban board of all tasks by default. If project name is specified only tasks tagged with project name will be displayed. Task sorted into three columns - today, backlog, and blocked.
|
||||
|
||||
"The 'Today' column is for tasks that are actively being worked on. The 'Backlog' column is for tasks that haven't been started yet or are not currently being addressed. The 'Blocked' column is for tasks that cannot be worked on at the moment."
|
||||
|
||||
All columns are sorted by due date first then creation date.
|
||||
|
||||
Each task is prefixed with an **Active id** that can be used in lieu of a task name.
|
||||
|
||||
|
||||
##### `dodo new <task name> due:<task due date> project:<project tag>`
|
||||
Create new task. By default new task is added to the backlog.
|
||||
|
||||
|
||||
##### `dodo <today/backlog/blocked> <task name or active id>`
|
||||
Move task to specified column
|
||||
|
||||
|
||||
##### `dodo done <task name or active id>`
|
||||
Complete task and remove from active boards
|
||||
|
||||
|
||||
##### `dodo change <task name or active id> <changed task name> due:<changed or new due date> project:<changed or new project tag>`
|
||||
Alter specified task. Any of the changed properties can be omitted to default to unaltered.
|
||||
|
||||
|
||||
##### `dodo log <task name or active id>`
|
||||
Add log entry to specified task
|
||||
|
||||
##### `dodo view_logs <task name or active id>`
|
||||
View specified task log entries
|
||||
|
||||
##### `dodo delete <task name or active id>`
|
||||
Delete specified task from all boards and purge data
|
||||
|
35
src/dodo.c
35
src/dodo.c
@ -148,6 +148,8 @@ int display_task_list(int start_col, sqlite3 *db, char* colnames, char* table, c
|
||||
if ( gen_sql_select_stmt(db, &out_stmt, colnames, table, status) ){
|
||||
return -1;
|
||||
}
|
||||
|
||||
// TODO: prob should be a func begin
|
||||
// while there is still rows available
|
||||
while ( rc = sqlite3_step(out_stmt) == SQLITE_ROW ){
|
||||
// for each column print the column
|
||||
@ -158,6 +160,7 @@ int display_task_list(int start_col, sqlite3 *db, char* colnames, char* table, c
|
||||
}
|
||||
// move down one and over to the start of the current task column
|
||||
printf("\n");
|
||||
// end
|
||||
X_goright(start_col);
|
||||
}
|
||||
|
||||
@ -184,7 +187,7 @@ int display_task_list(int start_col, sqlite3 *db, char* colnames, char* table, c
|
||||
// pass in the args and return the title and due date
|
||||
// due date passed as NULL if for delete
|
||||
// TODO input validation for strings implement in strings!
|
||||
int arg_parser(int argc, char** argv, char** title, char** due_date){
|
||||
int parse_args(int argc, char** argv, char** title, char** due_date){
|
||||
if ( argc > 1 ){
|
||||
*title = argv[2];
|
||||
}
|
||||
@ -195,6 +198,8 @@ int arg_parser(int argc, char** argv, char** title, char** due_date){
|
||||
|
||||
}
|
||||
|
||||
// TODO: the way this ensures that we are only passing in
|
||||
// valid inputs is stupid and ugly FIX
|
||||
int add_task(sqlite3 *db, int argc, char** argv){
|
||||
int rc = 0;
|
||||
char* table = "tasks";
|
||||
@ -204,9 +209,14 @@ int add_task(sqlite3 *db, int argc, char** argv){
|
||||
char values[100];
|
||||
sqlite3_stmt* out_stmt;
|
||||
|
||||
arg_parser(argc, argv, &title, &due_date);
|
||||
parse_args(argc, argv, &title, &due_date);
|
||||
|
||||
if ( due_date != NULL ){
|
||||
snprintf(values, 100, "('%s', '%s')", title, due_date);
|
||||
}else{
|
||||
colnames = "(title)";
|
||||
snprintf(values, 100, "('%s')", title);
|
||||
}
|
||||
|
||||
if ( gen_sql_insert_stmt(db, &out_stmt, table, colnames, values) ){
|
||||
return -1;
|
||||
@ -217,27 +227,6 @@ int add_task(sqlite3 *db, int argc, char** argv){
|
||||
|
||||
checksqlerr(rc, "broken in add_task");
|
||||
return 1;
|
||||
|
||||
// Format Col names like this (col1, col2, col3)
|
||||
//char* colnames = "(title, due_date)";
|
||||
|
||||
// Format values like this
|
||||
// For first row For second row For third row
|
||||
// (col1val, col2val, col3val), (col1val, col2val, col3val), (col1val, col2val, col3val)
|
||||
// char* values[ARG_MAX];
|
||||
// sqlite3_stmt* out_stmt;
|
||||
//
|
||||
//
|
||||
// if ( gen_sql_insert_stmt(db, &out_stmt, table, colnames, values) ){
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// if ( ( rc = sqlite3_step(out_stmt) ) == SQLITE_DONE){
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// checksqlerr(rc, "broken in add_task");
|
||||
// return 1;
|
||||
}
|
||||
|
||||
// Print kanban table
|
||||
|
Loading…
Reference in New Issue
Block a user