Add -n option to disable pager

This commit is contained in:
Rob Pearce 2021-11-08 18:20:37 +11:00
parent 269c28c4d3
commit 575d29d2cb
1 changed files with 14 additions and 7 deletions

21
t.sh
View File

@ -61,6 +61,7 @@ function usage() {
echo " -l xx Specify name of local vdirsyncer storage name (default: $DEFAULT_VDS_LOCAL)"
echo " -r xx Specify name of remote vdirsyncer storage name (default: $DEFAULT_VDS_REMOTE)"
echo " -s Auto-sync with server when complete."
echo " -S Sort tasks and subtasks alphabetically"
echo
printf "$format" "COMMAND" "DESCRIPTION" "SYNONYMS"
for x in $valid_modes; do
@ -953,12 +954,14 @@ function nextline() {
local dummy morestring
morestring="<------ more ------>"
printed=$((printed + 1));
if [[ $printed -ge $((rows - 2)) ]]; then
echo -en "${CYAN}${morestring}${PLAIN}"
read -n1 -s dummy
printf "\r%*s\r" ${#morestring}
printed=0
needtitle=1
if [[ $USEPAGER -eq 1 ]]; then
if [[ $printed -ge $((rows - 2)) ]]; then
echo -en "${CYAN}${morestring}${PLAIN}"
read -n1 -s dummy
printf "\r%*s\r" ${#morestring}
printed=0
needtitle=1
fi
fi
}
@ -1449,8 +1452,9 @@ TESTMODE=0
AUTOSYNC=0
CALID=$(cat "$confdir/defaultcal")
WANTSORT=0
USEPAGER=1
ARGS="fhic:dsStyl:r:"
ARGS="fhic:dnsStyl:r:"
while getopts "$ARGS" i; do
case "$i" in
h)
@ -1467,6 +1471,9 @@ while getopts "$ARGS" i; do
l)
VDS_LOCAL="$OPTARG"
;;
n)
USEPAGER=0
;;
r)
VDS_REMOTE="$OPTARG"
;;