aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-11-10 15:55:24 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-11-10 15:55:24 -0300
commite55f604ff9da09502860bfc243936b7c303c086f (patch)
tree16c7ec7373607692fea98b3850235aa01e4566e8
parent13876e9df1e1145d7220ad3b55b4b95559002663 (diff)
downloadscripts-e55f604ff9da09502860bfc243936b7c303c086f.tar.gz
scripts-e55f604ff9da09502860bfc243936b7c303c086f.tar.bz2
Feat: improve show script
-rwxr-xr-xshow13
1 files changed, 9 insertions, 4 deletions
diff --git a/show b/show
index 35008dc..8f3053b 100755
--- a/show
+++ b/show
@@ -43,7 +43,12 @@ fi
# Dispatch
#find $DOCS -iname "*$ITEM*" | head -1 | while read entry; do xdg-open "$entry"; done
-grep -- "$ITEM" $LIST | while read entry; do
- echo "Opening $entry..."
- cd $DOCS && xdg-open "$entry"
-done
+if [ "$ITEM" == "--search" ]; then
+ shift
+ grep -i -- "$*" $LIST
+else
+ grep -i -- "$ITEM" $LIST | while read entry; do
+ echo "Opening $entry..."
+ cd $DOCS && xdg-open "$entry"
+ done
+fi