diff --git a/completion/zsh/_yadm b/completion/zsh/_yadm index 9423ac51..be2dc51f 100644 --- a/completion/zsh/_yadm +++ b/completion/zsh/_yadm @@ -7,6 +7,20 @@ zstyle -T ':completion:*:yadm:argument-1:descriptions:' format && \ 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\n", yadm_path, $2, $1}' )) + + _describe 'command' yadm_options + _files +} + +function _yadm-checkout(){ + _yadm-add +} + _yadm-alt() { return 0 }