only support one reference in the arguments

This allows multi-word references to be passed easier to the program
This commit is contained in:
Tim Cooper 2018-12-22 09:21:41 -06:00
parent b1688d662a
commit eb41fefb9c
2 changed files with 5 additions and 12 deletions

View File

@ -4,13 +4,13 @@ Read the Word of God from your terminal
## Usage
usage: ./kjv [flags] <references...>
usage: ./kjv [flags] [reference...]
-l list books
-W no line wrap
-h show help
References types:
Reference types:
<Book>
Individual book
<Book>:<Chapter>

13
kjv.sh
View File

@ -18,13 +18,13 @@ fi
show_help() {
exec >&2
echo "usage: $(basename "$0") [flags] <references...>"
echo "usage: $(basename "$0") [flags] [reference...]"
echo
echo " -l list books"
echo " -W no line wrap"
echo " -h show help"
echo
echo " References types:"
echo " Reference types:"
echo " <Book>"
echo " Individual book"
echo " <Book>:<Chapter>"
@ -87,11 +87,4 @@ if [ $# -eq 0 ]; then
exit 0
fi
startIdx=$#
(while [ $# -gt 0 ]; do
if [ "${startIdx}" -ne $# ]; then
echo
fi
get_data kjv.tsv | awk -v cmd=ref -v ref="$1" "$(get_data kjv.awk)"
shift
done ) | ${PAGER}
get_data kjv.tsv | awk -v cmd=ref -v ref="$*" "$(get_data kjv.awk)" | ${PAGER}