#compdef nl autoload -U is-at-least _nl() { typeset -A opt_args typeset -a _arguments_options local ret=1 if is-at-least 5.2; then _arguments_options=(-s -S -C) else _arguments_options=(-s -C) fi local context curcontext="$curcontext" state line _arguments "${_arguments_options[@]}" : \ '-b+[use STYLE for numbering body lines]:STYLE:_default' \ '--body-numbering=[use STYLE for numbering body lines]:STYLE:_default' \ '-d+[use CC for separating logical pages]:CC:_default' \ '--section-delimiter=[use CC for separating logical pages]:CC:_default' \ '-f+[use STYLE for numbering footer lines]:STYLE:_default' \ '--footer-numbering=[use STYLE for numbering footer lines]:STYLE:_default' \ '-h+[use STYLE for numbering header lines]:STYLE:_default' \ '--header-numbering=[use STYLE for numbering header lines]:STYLE:_default' \ '-i+[line number increment at each line]:NUMBER:_default' \ '--line-increment=[line number increment at each line]:NUMBER:_default' \ '-l+[group of NUMBER empty lines counted as one]:NUMBER:_default' \ '--join-blank-lines=[group of NUMBER empty lines counted as one]:NUMBER:_default' \ '-n+[insert line numbers according to FORMAT]:FORMAT:(ln rn rz)' \ '--number-format=[insert line numbers according to FORMAT]:FORMAT:(ln rn rz)' \ '-s+[add STRING after (possible) line number]:STRING:_default' \ '--number-separator=[add STRING after (possible) line number]:STRING:_default' \ '-v+[first line number on each logical page]:NUMBER:_default' \ '--starting-line-number=[first line number on each logical page]:NUMBER:_default' \ '-w+[use NUMBER columns for line numbers]:NUMBER:_default' \ '--number-width=[use NUMBER columns for line numbers]:NUMBER:_default' \ '--help[Print help information.]' \ '-p[do not reset line numbers at logical pages]' \ '--no-renumber[do not reset line numbers at logical pages]' \ '-V[Print version]' \ '--version[Print version]' \ '::file:_files' \ && ret=0 } (( $+functions[_nl_commands] )) || _nl_commands() { local commands; commands=() _describe -t commands 'nl commands' commands "$@" } if [ "$funcstack[1]" = "_nl" ]; then _nl "$@" else compdef _nl nl fi