|
|
@ -60,15 +60,17 @@ if declare -F _git > /dev/null; then
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local yadm_switches=( $(yadm introspect switches 2>/dev/null) )
|
|
|
|
|
|
|
|
|
|
|
|
# this condition is so files are completed properly for --yadm-xxx options
|
|
|
|
# this condition is so files are completed properly for --yadm-xxx options
|
|
|
|
if [[ ! "$penultimate" =~ ^- ]]; then
|
|
|
|
if [[ " ${yadm_switches[*]} " != *" $penultimate "* ]]; then
|
|
|
|
# TODO: somehow solve the problem with [--yadm-xxx option] being
|
|
|
|
# TODO: somehow solve the problem with [--yadm-xxx option] being
|
|
|
|
# incompatible with what git expects, namely [--arg=option]
|
|
|
|
# incompatible with what git expects, namely [--arg=option]
|
|
|
|
_git
|
|
|
|
_git
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ "$current" =~ ^- ]]; then
|
|
|
|
if [[ "$current" =~ ^- ]]; then
|
|
|
|
local matching
|
|
|
|
local matching
|
|
|
|
matching=$(compgen -W "$(yadm introspect switches 2>/dev/null)" -- "$current")
|
|
|
|
matching=$(compgen -W "${yadm_switches[*]}" -- "$current")
|
|
|
|
__gitcompappend "$matching"
|
|
|
|
__gitcompappend "$matching"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|