1
2
3
4
5
6
7
8
9
#!/bin/zsh
setopt no_unset warn_create_global no_multibyte  # count bytes in argv[1]
zmodload zsh/zutil

typeset -ga plumb_src plumb_dst plumb_wdir plumb_type plumb_attr

zparseopts -D -E s:=plumb_src d:=plumb_dst w:=plumb_wdir t:=plumb_type a:=plumb_attr || exit $?

printf "%s\n%s\n%s\n%s\n%s\n%d\n%s" "${plumb_src:-fakeplumb}" "$plumb_dst" "$plumb_wdir" "${plumb_type:-text}" "${plumb_attr}" "$#1" "$1"