mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-06-14 10:51:41 +00:00
Add completion for Git submodule moving and removing
This commit is contained in:
27
modules/git/functions/_git-submodule-remove
Normal file
27
modules/git/functions/_git-submodule-remove
Normal file
@ -0,0 +1,27 @@
|
||||
#compdef git-submodule-remove
|
||||
#autoload
|
||||
|
||||
#
|
||||
# Completes git-submodule-remove.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
local -a submodules
|
||||
local submodule
|
||||
|
||||
while IFS=$'\n' read submodule; do
|
||||
submodules+=("$submodule")
|
||||
done < <(
|
||||
git config --file "$(git-root)/.gitmodules" --list \
|
||||
| grep '.path=' \
|
||||
| cut -d= -f2-
|
||||
)
|
||||
|
||||
_describe -t submodule 'submodules' submodules && return 0
|
||||
|
Reference in New Issue
Block a user