From: Paul Hänsch Date: Wed, 20 Sep 2023 21:08:10 +0000 (+0200) Subject: `changes` macro: allow multiple location arguments X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=aeeb2190338de08393ee52ca1cd4873f2dc3208a;p=shellwiki `changes` macro: allow multiple location arguments --- diff --git a/macros/changes b/macros/changes index 596a237..54f4782 100755 --- a/macros/changes +++ b/macros/changes @@ -22,12 +22,15 @@ _(){ printf %s\\n "$*"; } [ "${LANGUAGE}" -a -r "${_EXEC}/l10n/${LANGUAGE}.sh" ] && . "${_EXEC}/l10n/${LANGUAGE}.sh" LANGUAGES='' glob="/" depth=-1 +set -- "$@" -- while [ $# -gt 0 ]; do case $1 in --system) glob_system_pages=true; shift 1;; :*) LANGUAGES="${LANGUAGES}${LANGUAGES:+ }${1#:}"; shift 1;; --depth) depth="$2"; shift 2;; - *) glob="$1"; shift 1;; + --) shift 1; break;; + *) set -- "$@" "$1"; shift 1;; esac; done +[ "$*" ] || set -- / page='' page_abs='' ostamp='' odate='' lstamp='' ldate='' row='' rowstate='' @@ -35,7 +38,11 @@ printf '\n' for l in $LANGUAGES; do printf '' "$l"; done printf '\n\n' -page_glob "$glob" "$depth" |while read page; do +for glob in "$@"; do + page_glob "$glob" "$depth" +done \ +| sort -u \ +| while read page; do page_abs="$(page_abs "$page")" acl_read "${page_abs}" || continue
Page%s