diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2020-11-10 15:55:24 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2020-11-10 15:55:24 -0300 |
commit | e55f604ff9da09502860bfc243936b7c303c086f (patch) | |
tree | 16c7ec7373607692fea98b3850235aa01e4566e8 | |
parent | 13876e9df1e1145d7220ad3b55b4b95559002663 (diff) | |
download | scripts-e55f604ff9da09502860bfc243936b7c303c086f.tar.gz scripts-e55f604ff9da09502860bfc243936b7c303c086f.tar.bz2 |
Feat: improve show script
-rwxr-xr-x | show | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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 |