Browse files

renamed done_today

  • Loading branch information...
1 parent c1d0f44 commit 295ec14e43e0a92ce91f88d51ca059003003dee2 @jgallen23 committed May 14, 2012
Showing with 45 additions and 15 deletions.
  1. +45 −0 scripts/done_today
  2. +0 −15 scripts/done_today.sh
View
45 scripts/done_today
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+
+DATE=`date +%Y-%m-%d`
+TASKS=~/Dropbox/Notes/personal.taskpaper
+
+
+all() {
+ echo "Completed $DATE:"
+ echo "----------------"
+ grep "@done($DATE)" $TASKS | tr -d '\011' | sed -e "s/@project(\(.*\))/[\1]/" | sed -e "s/@.*[@|\[]/[/g"
+}
+
+search() {
+ keyword=$1
+ echo $keyword
+ echo "$keyword Tasks Completed $DATE:"
+ echo "----------------"
+ grep "@done($DATE)" $TASKS | grep -i "@project($keyword" | tr -d '\011' | sed -e "s/@project(\(.*\))/[\1]/" | sed -e "s/@.*[@|\[]/[/g"
+}
+
+while test $# -ne 0; do
+ arg=$1
+ shift
+ case $arg in
+ -d|--date)
+ DATE=$1
+ ;;
+ -o|--offset)
+ DATE=`date -v$1 +%Y-%m-%d`
+ ;;
+ -y|--yesterday)
+ DATE=`date -v-1d +%Y-%m-%d`
+ ;;
+ -m|--month)
+ DATE="`date +%Y-%m`-.."
+ ;;
+ -s|--search)
+ search $1
+ exit
+ ;;
+ esac
+done
+all
+
+
View
15 scripts/done_today.sh
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-TODAY=`date +%Y-%m-%d`
-TASKS=~/Dropbox/Notes/personal.taskpaper
-
-
-echo "Completed Today:"
-echo "----------------"
-if [ -z $1 ]; then
- grep "@done($TODAY)" $TASKS | tr -d '\011' | sed -e "s/@project(\(.*\))/[\1]/" | sed -e "s/@.*[@|\[]/[/g"
-else
- grep "@done($TODAY)" $TASKS | grep -i "@project($1" | tr -d '\011' | sed -e "s/@project(\(.*\))/[\1]/" | sed -e "s/@.*[@|\[]/[/g"
-fi
-
-

0 comments on commit 295ec14

Please sign in to comment.