File: _seq

package info (click to toggle)
zsh 5.9-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,856 kB
  • sloc: ansic: 108,138; sh: 6,976; makefile: 722; perl: 687; awk: 291; sed: 16
file content (28 lines) | stat: -rw-r--r-- 930 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#compdef seq gseq

local variant args

_pick_variant -r variant gnu=GNU $OSTYPE --version

args=( ':: :_guard "^-[^0-9]*" '{first,step,last} )
case $variant in
  gnu)
    args+=(
      '(--help --version)'{-f+,--format=}'[use printf style floating-point format]:format'
      '(--help --version -s --separator)'{-s+,--separator=}'[use specified separator for numbers]:separator [\n]'
      '(--help --version -w --equal-width)'{-w,--equal-width}'[equalize width by padding with leading zeroes]'
      '(- 1 2 3)--help[display usage information]'
      '(- 1 2 3)--version[display version information]'
     )
  ;;
  *)
    args+=(
      '-f+[use printf style floating-point format]:format'
      '-s+[use specified separator for numbers]:separator [\n]'
      '-t+[use specified string to terminate numbers]:string [\n]'
      '-w[equalize width by padding with leading zeroes]'
    )
  ;;
esac

_arguments -s -A '-[^1-9]*' $args