Move __fish_complete_abook_formats to abook

This commit is contained in:
mk2
2019-08-04 11:43:15 +09:00
committed by Fabian Homborg
parent 67cf50eda4
commit 0083555925
2 changed files with 13 additions and 13 deletions

View File

@@ -1,4 +1,17 @@
function __fish_complete_abook_formats --description 'Complete abook formats'
set -l pat
switch $argv[1]
case in
set pat '/output:/,$d; /input:\|^$/d'
case out
set pat '/input:/,/output:/d; /^$/d'
case '*'
return 1
end
abook --formats | sed -e $pat -e 's/^\s\+//'
end
complete -c abook -s h -d 'Show usage'
complete -c abook -s C -l config -d 'Use an alternative configuration file' -r
complete -c abook -l datafile -d 'Use an alternative addressbook file' -r

View File

@@ -1,13 +0,0 @@
function __fish_complete_abook_formats --description 'Complete abook formats'
set -l pat
switch $argv[1]
case in
set pat '/output:/,$d; /input:\|^$/d'
case out
set pat '/input:/,/output:/d; /^$/d'
case '*'
return 1
end
abook --formats | sed -e $pat -e 's/^\s\+//'
end