From: Richard Hartmann Date: Sun, 27 Aug 2017 19:28:10 +0000 (+0200) Subject: Merge pull request #224 from danielshahaf/completion-fix-error-code-v1 X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/6b5ef0253b6858e3cb4fd265d2f7d99b597065ee?hp=-c Merge pull request #224 from danielshahaf/completion-fix-error-code-v1 completion: Return the correct error code from __vcsh_*. --- 6b5ef0253b6858e3cb4fd265d2f7d99b597065ee diff --combined _vcsh index 6880f72,77ff976..1661e19 --- a/_vcsh +++ b/_vcsh @@@ -24,7 -24,7 +24,7 @@@ function _vcsh-enter () } function _vcsh-foreach () { - _dispatch git git + _dispatch vcsh-foreach git } function _vcsh-help () { @@@ -95,9 -95,6 +95,9 @@@ function _vcsh () local state vcshcommand local -a args subcommands + local VCSH_REPO_D + : ${VCSH_REPO_D:="${XDG_CONFIG_HOME:-"$HOME/.config"}/vcsh/repo.d"} + subcommands=( "clone:clone an existing repository" "commit:commit in all repositories" @@@ -138,11 -135,10 +138,11 @@@ if ! (( ${+functions[_vcsh-$vcshcommand]} )); then # There is no handler function, so this is probably the name # of a repository. Act accordingly. - _dispatch git git + # FIXME: this may want to use '_dispatch vcsh git' + GIT_DIR=$VCSH_REPO_D/$words[1].git _dispatch git git else curcontext="${curcontext%:*:*}:vcsh-${vcshcommand}:" - _call_function ret _vcsh-${vcshcommand} + _call_function ret _vcsh-${vcshcommand} && (( ret )) fi fi fi