From 6589d58af38c739ff0ba5fd1ce69a5520254db37 Mon Sep 17 00:00:00 2001 From: spinach <19keegandeppe@gmail.com> Date: Sat, 4 Mar 2023 17:27:24 -0500 Subject: [PATCH] fixed less --- quotes.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quotes.sh b/quotes.sh index 5af5ecb..ca94da5 100755 --- a/quotes.sh +++ b/quotes.sh @@ -5,7 +5,7 @@ usage() { usage $0 [-d|r][-f][-h] -d, --daily get the QOTD -r, --random get a random quote - -p, --pager use pager to prevent quitting until keypress + -l, --less use less to prevent quitting until keypress -f, --force force update the quote pool -h, --help display this message EOF @@ -61,7 +61,7 @@ for arg in "$@"; do '--help') set -- "$@" '-h' ;; '--random') set -- "$@" '-r' ;; '--daily') set -- "$@" '-d' ;; - '--pager') set -- "$@" '-p' ;; + '--less') set -- "$@" '-l' ;; '--force') set -- "$@" '-f' ;; *) set -- "$@" "$arg" ;; esac @@ -83,8 +83,8 @@ while getopts "hrdfp" opt ; do 'f') UPDATE=true ;; - 'p') - PAGE=true + 'l') + DISP=true ;; '?') usage @@ -98,8 +98,8 @@ QUOTE=$(get_quote "$TYPE") Q=$(echo "$QUOTE" | gojq '.q' | tr -d '"') A=$(echo "$QUOTE" | gojq '.a' | tr -d '"') -if [ -n "$PAGE" ] ; then - printf '"%s" - %s\n' "$Q" "$A" | $PAGER +if [ -n "$DISP" ] ; then + printf '"%s" - %s\n' "$Q" "$A" | less else printf '"%s" - %s\n' "$Q" "$A" fi