From eb41fefb9c7c95544f17bd6c0346a4db57afe897 Mon Sep 17 00:00:00 2001 From: Tim Cooper Date: Sat, 22 Dec 2018 09:21:41 -0600 Subject: [PATCH] only support one reference in the arguments This allows multi-word references to be passed easier to the program --- README.md | 4 ++-- kjv.sh | 13 +++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f5b2dae..38c9ca4 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ Read the Word of God from your terminal ## Usage - usage: ./kjv [flags] + usage: ./kjv [flags] [reference...] -l list books -W no line wrap -h show help - References types: + Reference types: Individual book : diff --git a/kjv.sh b/kjv.sh index 6b4820c..31c3f99 100755 --- a/kjv.sh +++ b/kjv.sh @@ -18,13 +18,13 @@ fi show_help() { exec >&2 - echo "usage: $(basename "$0") [flags] " + 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 " " echo " Individual book" echo " :" @@ -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}