diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-09-02 23:15:05 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-09-02 23:15:05 +0200 |
commit | 2dd35abfc7ec993600b6c70578102703a820eb70 (patch) | |
tree | 5961c813a1fdd25137bd63202cd482eb26c66fad /etc | |
parent | 3eaabe58b7bb46310fbf8daacd351f96d78989b7 (diff) |
fbi completion: No more eval
Diffstat (limited to 'etc')
-rw-r--r-- | etc/completions/_fbi | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/etc/completions/_fbi b/etc/completions/_fbi index 0751e5a..dd45c42 100644 --- a/etc/completions/_fbi +++ b/etc/completions/_fbi @@ -3,11 +3,8 @@ ## Daniel Friesel <derf@derf.homelinux.org> ## https://derf.homelinux.org/~derf/dotfiles/completion/_fbi -typeset arguments -typeset IFS=$'\n' -typeset fonts - -fonts='fc-list | cut -d ":" -f 1' +typeset -a arguments +typeset expl lstate arguments=( -{1,once}"[don't loop]" @@ -20,7 +17,7 @@ arguments=( '-comments[display image comments]' -{d,device}'[set framebuffer device]:framebuffer device:_path_files -W /dev -g "fb*"' -{e,edit}'[enable editing]' - -{f,font}'[set font]:font:($(eval $fonts))' + -{f,font}'[set font]:font:->font' '-fitwidth[zoom to width only]' -{g,gamma}'[gamma correction]:gamma: ' -{h,help}'[show help]' @@ -41,3 +38,16 @@ arguments=( ) _arguments -s $arguments + +while [[ -n $state ]]; do + lstate=$state + state='' + case $lstate in + font) + typeset IFS=$'\n' + typeset -a fonts + _wanted font expl 'font' \ + compadd $(fc-list | cut -d ":" -f 1 2>&1) + ;; + esac +done |