implement --force

This commit is contained in:
NRK
2021-05-01 07:51:08 +06:00
parent bf3dbb5f30
commit da2342b738

7
sxbm
View File

@ -150,11 +150,14 @@ bm_open(){
local LINK_NUM=$( echo "$LINK" | wc -l ) ||
die "No links found"
if [ "$LINK_NUM" -gt 1 ]; then
if [ "$LINK_NUM" -gt 1 ] && [ -z "$FORCE" ]; then
die "Too many links\nUse 'sxbm open -f' to force open them all\n\n$( echo "$LINK" )"
fi
$BROWSER $( echo "$LINK" | awk "{print \$2}" )
while [ "$LINK_NUM" -gt 0 ]; do
$BROWSER $( echo "$LINK" | awk "NR == $LINK_NUM {print \$2}" )
LINK_NUM=$(($LINK_NUM - 1))
done
}
############