~kris/hacks

stask

30ed01d43a4c4df56ea8a9eef9c17db394b0e26d — Kris Yotam 5 months ago 58fd6f3
stask ls <list> shows tasks in a list
2 files changed, 9 insertions(+), 1 deletions(-)

M stask.1
M stask.c
M stask.1 => stask.1 +6 -0
@@ 78,6 78,12 @@ Print version and exit.
List all task lists with task counts and creation dates. This is the
default when no arguments are given.
.TP
.BI ls " list"
Show all tasks in
.IR list .
Equivalent to
.BI stask " list" .
.TP
.BI new " list"
Create a new task list named
.IR list .

M stask.c => stask.c +3 -1
@@ 223,8 223,10 @@ main(int argc, char *argv[])
	if (db_open(&tdb) < 0)
		return 1;

	if (argc < 2 || strcmp(argv[1], "ls") == 0) {
	if (argc < 2 || (argc == 2 && strcmp(argv[1], "ls") == 0)) {
		cmd_ls(&tdb);
	} else if (argc == 3 && strcmp(argv[1], "ls") == 0) {
		cmd_show(&tdb, argv[2]);
	} else if (strcmp(argv[1], "new") == 0) {
		if (argc < 3) usage();
		cmd_new(&tdb, argv[2]);