4
2
mirror of https://github.com/getbible/getverse.git synced 2024-11-21 20:05:10 +00:00

Fixed bookname filter/search

This commit is contained in:
Llewellyn van der Merwe 2021-05-06 01:53:10 +02:00
parent c6eb6198b6
commit 8db4e91296
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
2 changed files with 4 additions and 2 deletions

View File

@ -14,7 +14,8 @@ QUERY="${1:-62 3:16-18}"
# set the translation (default: kjv)
VERSION="${2:-kjv}"
# get the name from the query TODO: find better filter
BOOKNAME=$(echo ${QUERY%%[0-9]?:*} | xargs echo -n)
BOOKNAME=$(echo ${QUERY%%[0-9][0-9]?:*} | xargs echo -n)
BOOKNAME=$(echo ${BOOKNAME%%[0-9]?:*} | xargs echo -n)
BOOKNAME=$(echo ${BOOKNAME%%[0-9]:*} | xargs echo -n)
# check if the name was given by number
re='^[0-9]+$'

View File

@ -14,7 +14,8 @@ QUERY="${1:-62 3:16-18}"
# set the translation (default: kjv)
VERSION="${2:-kjv}"
# get the name from the query TODO: find better filter
BOOKNAME=$(echo ${QUERY%%[0-9]?:*} | xargs echo -n)
BOOKNAME=$(echo ${QUERY%%[0-9][0-9]?:*} | xargs echo -n)
BOOKNAME=$(echo ${BOOKNAME%%[0-9]?:*} | xargs echo -n)
BOOKNAME=$(echo ${BOOKNAME%%[0-9]:*} | xargs echo -n)
# check if the name was given by number
re='^[0-9]+$'