From b047543708c22386dcf728b214869bba7b365142 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Sat, 1 Jan 2022 16:11:51 +0200 Subject: [PATCH] Even more Git functions completions. --- .bash_completion.d/git | 30 ++++++++++++++++++++++++++++++ .bash_completion.d/git-skel | 16 ---------------- 2 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 .bash_completion.d/git delete mode 100644 .bash_completion.d/git-skel diff --git a/.bash_completion.d/git b/.bash_completion.d/git new file mode 100644 index 0000000..92f259b --- /dev/null +++ b/.bash_completion.d/git @@ -0,0 +1,30 @@ +# vim: ft=bash + +_git_bump () { + local cur prev words cword opts + _init_completion || return + COMPREPLY=($(compgen -W 'major minor patch' -- "$cur")) +} + +_git_license () { + local cur prev words cword opts + _init_completion || return + licenses="$(license -list | awk '{print $1}')" + COMPREPLY=($(compgen -W "$licenses" -- "$cur")) +} + +_git_namespace_backup () { + local cur prev words cword opts + _init_completion || return + pushd "$HOME/Repositories" >/dev/null + COMPREPLY=($(compgen -o dirnames -d -- "$cur")) + popd >/dev/null +} + +_git_skel () { + local cur prev words cword opts + _init_completion || return + pushd "$HOME/.config/git/skel" >/dev/null + COMPREPLY=($(compgen -o filenames -f -- "$cur")) + popd >/dev/null +} diff --git a/.bash_completion.d/git-skel b/.bash_completion.d/git-skel deleted file mode 100644 index c207b95..0000000 --- a/.bash_completion.d/git-skel +++ /dev/null @@ -1,16 +0,0 @@ -# vim: ft=bash - -_git_skel () { - local cur prev words cword opts - _init_completion || return - pushd "$HOME/.config/git/skel" >/dev/null - COMPREPLY=($(compgen -o filenames -f -- "$cur")) - popd >/dev/null -} - -if [ -f /usr/share/bash-completion/completions/git ] -then - . /usr/share/bash-completion/completions/git - __git_complete git-skel _git_skel -fi - -- GitLab