add interactive mode

This commit is contained in:
Tim Cooper 2018-09-18 19:05:06 -05:00
parent 8bd831790f
commit b1688d662a

14
kjv.sh
View File

@ -72,7 +72,19 @@ while [ $# -gt 0 ]; do
done
if [ $# -eq 0 ]; then
show_help
if [ ! -t 0 ]; then
show_help
fi
# Interactive mode
while true; do
printf "kjv> "
if ! read -r ref; then
break
fi
get_data kjv.tsv | awk -v cmd=ref -v ref="$ref" "$(get_data kjv.awk)" | ${PAGER}
done
exit 0
fi
startIdx=$#