Skip to content
Snippets Groups Projects
Commit b99d2691 authored by Daniel Shahaf's avatar Daniel Shahaf
Browse files

completion: Pass GIT_DIR to _git.

This enables file completion at «vcsh foo add <TAB>».
parent 36a7cedf
Branches
No related tags found
No related merge requests found
...@@ -95,6 +95,9 @@ function _vcsh () { ...@@ -95,6 +95,9 @@ function _vcsh () {
local state vcshcommand local state vcshcommand
local -a args subcommands local -a args subcommands
local VCSH_REPO_D
: ${VCSH_REPO_D:="${XDG_CONFIG_HOME:-"$HOME/.config"}/vcsh/repo.d"}
subcommands=( subcommands=(
"clone:clone an existing repository" "clone:clone an existing repository"
"commit:commit in all repositories" "commit:commit in all repositories"
...@@ -135,7 +138,7 @@ function _vcsh () { ...@@ -135,7 +138,7 @@ function _vcsh () {
if ! (( ${+functions[_vcsh-$vcshcommand]} )); then if ! (( ${+functions[_vcsh-$vcshcommand]} )); then
# There is no handler function, so this is probably the name # There is no handler function, so this is probably the name
# of a repository. Act accordingly. # of a repository. Act accordingly.
_dispatch git git GIT_DIR=$VCSH_REPO_D/$words[1].git _dispatch git git
else else
curcontext="${curcontext%:*:*}:vcsh-${vcshcommand}:" curcontext="${curcontext%:*:*}:vcsh-${vcshcommand}:"
_call_function ret _vcsh-${vcshcommand} _call_function ret _vcsh-${vcshcommand}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment