From: Silvio Rhatto Date: Tue, 10 Nov 2020 18:55:24 +0000 (-0300) Subject: Feat: improve show script X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=e55f604ff9da09502860bfc243936b7c303c086f;p=scripts.git Feat: improve show script --- 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