support PAGER pipe for help output
This commit is contained in:
8
todo.sh
8
todo.sh
@@ -787,7 +787,13 @@ case $action in
|
|||||||
cleanup ;;
|
cleanup ;;
|
||||||
|
|
||||||
"help" )
|
"help" )
|
||||||
help
|
if [ -t 1 ] ; then # STDOUT is a TTY
|
||||||
|
if (exec which ${PAGER:-less} 2>/dev/null >/dev/null); then
|
||||||
|
# we have a working PAGER (or less as a default)
|
||||||
|
help | exec ${PAGER:-less}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
help # just in case something failed above, we go ahead and just spew to STDOUT
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"list" | "ls" )
|
"list" | "ls" )
|
||||||
|
|||||||
Reference in New Issue
Block a user