From: Paul Hänsch Date: Mon, 14 Aug 2023 20:56:00 +0000 (+0200) Subject: drop page_children() function and join it into page_glob(), hide [system] pages from... X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=99eb58aebae213abb3a677493b614b592c7f0db6;p=shellwiki drop page_children() function and join it into page_glob(), hide [system] pages from globbing by default --- diff --git a/macros/pagelist b/macros/pagelist index 54d4a69..f6828fd 100755 --- a/macros/pagelist +++ b/macros/pagelist @@ -4,14 +4,25 @@ . "$_EXEC/acl.sh" . "$_EXEC/tools.sh" -dir="${1:-./}" -depth="${2:-1}" +while [ $# -gt 0 ]; do case $1 in + --system) glob_system_pages=true; shift 1;; + --depth) depth="$2" shift 2;; + *) if [ ! "$dir" ]; then + dir="$1" + elif [ ! "$depth" ]; then + depth="$1" + fi + shift 1;; +esac; done + +[ "$dir" ] || dir=./ +[ "$depth" -ge 0 -o "$depth" -le 0 ] 2>&0 || depth=0 + printf '