From: Paul Hänsch Date: Wed, 6 Feb 2019 23:35:15 +0000 (+0100) Subject: omit fullname function (which is now in pdi_load) X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=42508761575d9037ba1b6c52339f7a729505fd37;p=lobster omit fullname function (which is now in pdi_load) --- diff --git a/cards/list.sh b/cards/list.sh index 6775191..2cdfcbc 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -5,22 +5,6 @@ unescape() { [ $# = 0 ] && sed -E 's;\\(.);\1;g' || printf %s "$*" |sed -E 's;\\(.);\1;g'; } upcase=' y;abcdefghijklmnopqrstuvwxyzäöüé;ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÉ;; ' -card_fullname(){ - local card="$1" N n1 n2 n3 n4 n5 - - if pdi_value "$card" FN; then - return - elif N="$(pdi_value "$card" N)"; then - IFS=\; read n1 n2 n3 n4 n5 <<-EOF - $(pdi_value "$card" N) - EOF - printf '%s %s %s %s %s' "$n4" "$n2" "$n3" "$n1" "$n5" - else - pdi_value "$card" NICKNAME - fi -} - - card_item(){ local card="$1" local item cnt c @@ -30,7 +14,7 @@ card_item(){ cnt="$(pdi_count "$card" "$item")" case $item in - FN) printf '[h2 .item .FN ­%s]' "$(card_fullname "$card" |unescape |HTML)" + FN) printf '[h2 .item .FN ­%s]' "$(pdi_value "$card" FN |unescape |HTML)" ;; GENDER) printf '[span .item .GENDER ­%s]' "$(pdi_value "$card" GENDER |l10n)" ;; @@ -152,17 +136,16 @@ filter_cards(){ order_cards() { local cardfile card - echo ORDER $order >&2 while read cardfile; do card="$(pdi_load "$cardfile")" case $order in firstname) - printf '%s %s\n' "$(card_fullname "$card")" "$cardfile" + printf '%s %s\n' "$(pdi_value "$card" FN)" "$cardfile" ;; lastname) - printf '%s %s\n' "$(pdi_value "$card" N || card_fullname "$card")" "$cardfile" + printf '%s %s\n' "$(pdi_value "$card" N || pdi_value "$card" FN)" "$cardfile" ;; bdate) printf '%s %s\n' "$(pdi_value "$card" BDAY || printf 0000-00-00)" "$cardfile"