Fix duplicates from completion

This commit is contained in:
Joshua Cold 2022-05-07 12:41:00 -06:00 committed by Tim Byrne
parent beb83077d8
commit 7573e18a89
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
1 changed files with 6 additions and 5 deletions

View File

@ -8,12 +8,13 @@ zstyle -T ':completion:*:yadm:*:yadm' group-name && \
zstyle ':completion:*:yadm:*:yadm' group-name ''
function _yadm-add(){
local -a yadm_options yadm_path
yadm_path="$(yadm rev-parse --show-toplevel)"
yadm_options=$(yadm status --porcelain=v1 |
awk -v yadm_path=${yadm_path} '{printf "%s/\"%s\"\\:\"%s\" ", yadm_path, $2, $1 }' )
_alternative \
"args:custom arg:(($yadm_options))" \
'files:filename:_files'
yadm_options=($(yadm status --porcelain=v1 |
awk -v yadm_path=${yadm_path} '{printf "%s/%s ", yadm_path, $2}' ))
_describe 'command' yadm_options
_files
}
function _yadm-checkout(){