mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-07-10 04:21:37 +02:00
24 lines
713 B
Text
24 lines
713 B
Text
#compdef fold gfold
|
|
|
|
local variant
|
|
local -a args
|
|
|
|
_pick_variant -r variant busybox=BusyBox gnu='Free Soft' unix --version
|
|
|
|
args=(
|
|
'(-b --bytes)'{-b,--bytes}'[count bytes rather than columns]'
|
|
'(: -)--help[display help information]'
|
|
'(-s --spaces)'{-s,--spaces}'[fold on whitespace]'
|
|
'(-w --width)'{-w+,--width=}'[specify line width]:line width (columns or bytes)'
|
|
'(: -)--version[display version information]'
|
|
'*: :_files'
|
|
)
|
|
|
|
# Non-GNU variants don't support long options (except BusyBox's --help)
|
|
if [[ $variant == *busybox* ]]; then # See also: _busybox
|
|
args=( ${args:#((#s)|*\))(\*|)--^help*} )
|
|
elif [[ $variant != gnu ]]; then
|
|
args=( ${args:#((#s)|*\))(\*|)--*} )
|
|
fi
|
|
|
|
_arguments -s -S : $args
|