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

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