aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcollector9
1 files changed, 7 insertions, 2 deletions
diff --git a/collector b/collector
index 570d13c..387cb02 100755
--- a/collector
+++ b/collector
@@ -9,6 +9,7 @@
# Parameters
BASENAME="`basename $0`"
ACTION="$1"
+COLLECTOR_NAME="`echo $COLLECTOR_FILE | sed -e "s|$HOME|~|"`"
# Check
if [ -z "$COLLECTOR_FILE" ]; then
@@ -30,13 +31,17 @@ elif [ "$ACTION" == "add" ]; then
echo "* $*" >> "$COLLECTOR_FILE"
elif [ "$ACTION" == "list" ]; then
if grep -q -e "^ *\* " "$COLLECTOR_FILE"; then
- COLLECTOR_NAME="`echo $COLLECTOR_FILE | sed -e "s|$HOME|~|"`"
-
echo "Collected items at $COLLECTOR_NAME:"
echo ""
grep -e "^ *\* " "$COLLECTOR_FILE"
echo ""
fi
+elif [ "$ACTION" == "count" ]; then
+ if grep -q -e "^ *\* " "$COLLECTOR_FILE"; then
+ COUNT="`grep -e "^ *\* " "$COLLECTOR_FILE" | wc -l`"
+ echo "$COUNT collected items at $COLLECTOR_NAME"
+ echo ""
+ fi
elif [ "$ACTION" == "edit" ]; then
if [ ! -z "$EDITOR" ]; then
$EDITOR "$COLLECTOR_FILE"