aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xshow9
1 files changed, 9 insertions, 0 deletions
diff --git a/show b/show
index 4be01ac..2195702 100755
--- a/show
+++ b/show
@@ -4,6 +4,7 @@
#
# Parameters
+PROGRAM="$0"
BASENAME="`basename $0`"
DOCS="$HOME/data/doc"
FILELIST=".filelist"
@@ -59,6 +60,14 @@ fi
if [ "$ITEM" == "--search" ]; then
shift
grep -i -- "$*" $LIST
+elif [ "$ITEM" == "--watch" ]; then
+ (
+ cd $DOCS
+
+ while inotifywait -e modify -e create -e move -e delete .; do
+ $PROGRAM --refresh
+ done
+ )
else
grep -i -- "$ITEM" $LIST | while read entry; do
echo "Opening $entry..."