# Check
if [ -z "$ITEM" ]; then
- echo "usage: $BASENAME <item-name>"
+ echo "usage: $BASENAME [option] [<item-name>]"
exit 1
elif [ "$ITEM" == "--refresh" ]; then
__update_filelist
$PROGRAM --refresh
done
else
+ if [ "${ITEM:0:2}" == "--" ] && [ ! -z "$OPTION" ]; then
+ OPEN="${ITEM:2}"
+ ITEM="$OPTION"
+ else
+ OPEN="xdg-open"
+ fi
+
grep -i -- "$ITEM" $LIST | while read entry; do
echo "Opening $entry..."
- cd $DOCS && xdg-open "$entry"
+ cd $DOCS && $OPEN "$entry"
done
fi