Skip to content

Commit

Permalink
bin/ug(|rep)+: Let the helper script work if no helper is available
Browse files Browse the repository at this point in the history
With this patch:
ribalda@penguin:~/work/ugrep$ ./bin/ug+ root /etc/passwd
     1: root:x:0:0:root:/root:/bin/bash

Without this patch:
ribalda@penguin:~/work/ugrep$ /bin/ug+ root /etc/passwd

Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
  • Loading branch information
ribalda committed Nov 15, 2024
1 parent ffd990f commit 31eb88e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bin/ug+
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ fi
if [ -x "$(command -v exiftool)" ] ; then
filters="${filters}${filters:+,}gif,jpg,jpeg,mpg,mpeg,png,tiff:exiftool %"
fi
ug --filter="${filters}" "$@"
if [ -n "$filters" ]; then
ug --filter="${filters}" "$@"
else
ug "$@"
fi
6 changes: 5 additions & 1 deletion bin/ugrep+
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ fi
if [ -x "$(command -v exiftool)" ] ; then
filters="${filters}${filters:+,}gif,jpg,jpeg,mpg,mpeg,png,tiff:exiftool %"
fi
ugrep --filter="${filters}" "$@"
if [ -n "$filters" ]; then
ug --filter="${filters}" "$@"
else
ug "$@"
fi

0 comments on commit 31eb88e

Please sign in to comment.