remove list by line num
why the fuck would anyone want to list a specific line. makes no sense. search via title/tag like a normal human bean!
This commit is contained in:
12
sxbm
12
sxbm
@ -68,8 +68,6 @@ bm_list(){
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
expr "$1" : '[0-9]' > /dev/null &&
|
|
||||||
local QUERY_LINE="$1" ||
|
|
||||||
while [ -n "$1" ]; do
|
while [ -n "$1" ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
+*)
|
+*)
|
||||||
@ -83,16 +81,6 @@ bm_list(){
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$QUERY_LINE" ] &&
|
|
||||||
[ $QUERY_LINE -gt $(wc -l < "$DATA_FILE") ] &&
|
|
||||||
die "$QUERY_LINE doesn't exist. Use 'sxbm ls' to list all bookmark" ||
|
|
||||||
awk -v COL_LINK="$COL_LINK" -v COL_TITLE="$COL_TITLE" \
|
|
||||||
-v COL_LINE_NUM=$COL_LINE_NUM -v QUERY_LINE="$QUERY_LINE" \
|
|
||||||
' NR == QUERY_LINE { LINK=$1; $1="";
|
|
||||||
gsub(/+\w+/,"");
|
|
||||||
print COL_LINE_NUM NR ") " COL_LINK LINK " " COL_TITLE $0 ; }' \
|
|
||||||
"$DATA_FILE"
|
|
||||||
|
|
||||||
# POSIX shell doesn't have arrays.
|
# POSIX shell doesn't have arrays.
|
||||||
# Desperate times calls for desperate measures!
|
# Desperate times calls for desperate measures!
|
||||||
[ -n "$QUERY_TAG" ] &&
|
[ -n "$QUERY_TAG" ] &&
|
||||||
|
|||||||
Reference in New Issue
Block a user