diff --git a/Makefile b/Makefile index 0cf3638..6e08f01 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ -kjv: kjv.sh kjv.awk kjv.tsv - cat kjv.sh > $@ +drb: drb.sh drb.awk drb.tsv + cat drb.sh > $@ echo 'exit 0' >> $@ echo '#EOF' >> $@ - tar cz kjv.awk kjv.tsv >> $@ + tar cz drb.awk drb.tsv >> $@ chmod +x $@ -test: kjv.sh - shellcheck -s sh kjv.sh +test: drb.sh + shellcheck -s sh drb.sh .PHONY: test diff --git a/README.md b/README.md index 38c9ca4..e7e59d4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# kjv [![AUR](https://img.shields.io/badge/AUR-kjv--git-blue.svg)](https://aur.archlinux.org/packages/kjv-git/) +# drb Read the Word of God from your terminal ## Usage - usage: ./kjv [flags] [reference...] + usage: ./drb [flags] [reference...] -l list books -W no line wrap @@ -33,10 +33,10 @@ Read the Word of God from your terminal ## Build -kjv can be built by cloning the repository and then running make: +drb can be built by cloning the repository and then running make: - git clone https://github.com/bontibon/kjv.git - cd kjv + git clone https://github.com/Andrew-William-Smith/drb.git + cd drb make ## License diff --git a/kjv.awk b/drb.awk similarity index 95% rename from kjv.awk rename to drb.awk index 82ecbed..d568079 100644 --- a/kjv.awk +++ b/drb.awk @@ -8,9 +8,9 @@ BEGIN { FS = "\t" MAX_WIDTH = 80 - if (ENVIRON["KJV_MAX_WIDTH"] ~ /^[0-9]+$/) { - if (int(ENVIRON["KJV_MAX_WIDTH"]) < MAX_WIDTH) { - MAX_WIDTH = int(ENVIRON["KJV_MAX_WIDTH"]) + if (ENVIRON["DRB_MAX_WIDTH"] ~ /^[0-9]+$/) { + if (int(ENVIRON["DRB_MAX_WIDTH"]) < MAX_WIDTH) { + MAX_WIDTH = int(ENVIRON["DRB_MAX_WIDTH"]) } } @@ -151,7 +151,7 @@ function bookmatches(book, bookabbr, query) { } function printverse(verse, word_count, characters_printed) { - if (ENVIRON["KJV_NOLINEWRAP"] != "" && ENVIRON["KJV_NOLINEWRAP"] != "0") { + if (ENVIRON["DRB_NOLINEWRAP"] != "" && ENVIRON["DRB_NOLINEWRAP"] != "0") { printf("%s\n", verse) return } diff --git a/kjv.sh b/drb.sh similarity index 85% rename from kjv.sh rename to drb.sh index 5c4b59a..db5ca7c 100755 --- a/kjv.sh +++ b/drb.sh @@ -1,5 +1,5 @@ #!/bin/sh -# kjv: Read the Word of God from your terminal +# drb: Read the Word of God from your terminal # License: Public domain SELF="$0" @@ -59,10 +59,10 @@ while [ $# -gt 0 ]; do break elif [ "$1" = "-l" ]; then # List all book names with their abbreviations - get_data kjv.tsv | awk -v cmd=list "$(get_data kjv.awk)" + get_data drb.tsv | awk -v cmd=list "$(get_data drb.awk)" exit elif [ "$1" = "-W" ]; then - export KJV_NOLINEWRAP=1 + export DRB_NOLINEWRAP=1 shift elif [ "$1" = "-h" ] || [ "$isFlag" -eq 1 ]; then show_help @@ -73,7 +73,7 @@ done cols=$(tput cols 2>/dev/null) if [ $? -eq 0 ]; then - export KJV_MAX_WIDTH="$cols" + export DRB_MAX_WIDTH="$cols" fi if [ $# -eq 0 ]; then @@ -83,13 +83,13 @@ if [ $# -eq 0 ]; then # Interactive mode while true; do - printf "kjv> " + printf "drb> " if ! read -r ref; then break fi - get_data kjv.tsv | awk -v cmd=ref -v ref="$ref" "$(get_data kjv.awk)" | ${PAGER} + get_data drb.tsv | awk -v cmd=ref -v ref="$ref" "$(get_data drb.awk)" | ${PAGER} done exit 0 fi -get_data kjv.tsv | awk -v cmd=ref -v ref="$*" "$(get_data kjv.awk)" | ${PAGER} +get_data drb.tsv | awk -v cmd=ref -v ref="$*" "$(get_data drb.awk)" | ${PAGER}