From 99eb58aebae213abb3a677493b614b592c7f0db6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Mon, 14 Aug 2023 22:56:00 +0200 Subject: [PATCH] drop page_children() function and join it into page_glob(), hide [system] pages from globbing by default --- macros/pagelist | 19 ++++++++++++++---- tools.sh | 51 ++++++++++++++++++------------------------------- 2 files changed, 34 insertions(+), 36 deletions(-) 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 '