File: completion.zsh

package info (click to toggle)
f3d 1.3.1%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 20,420 kB
  • sloc: cpp: 28,581; sh: 306; xml: 155; python: 65; makefile: 21; javascript: 17
file content (16 lines) | stat: -rw-r--r-- 420 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#compdef f3d

local longopts
local shortopts
local arguments
local f3dhelp

f3dhelp=$(f3d --help 2>&1 | sed '1,/Examples/!d')

shortopts=$(echo $f3dhelp | grep "\-.," | sed "s/^ *\(-.\), *--[^ ]* *\(.*\)$/\1[\2]/")
longopts=$(echo $f3dhelp | grep "\-\-" | sed 's/=.*>//g' | sed 's/-.,//g' | sed "s/^ *\([^ ]*\) *\(.*\)$/\1[\2]/g")

arguments=("${(f)shortopts}")
arguments+=("${(f)longopts}")

_arguments "$arguments[@]"