773a0676dc21f58714c9734e5c076bf22197e1e2

Author
TheEdgeOfRage <git@theedgeofrage.com>
Committer
TheEdgeOfRage <git@theedgeofrage.com>
Date

Message

Add zsh completion for gsrb

Diff

 1diff --git a/dot_config/zsh/completions/_gsrb b/dot_config/zsh/completions/_gsrb
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..a2f9b184a052ce01e48a673d03d1e46edf00830a
 4--- /dev/null
 5+++ b/dot_config/zsh/completions/_gsrb
 6@@ -0,0 +1,15 @@
 7+#compdef gsrb
 8+
 9+_gsrb() {
10+	_arguments \
11+		'-i[interactive rebase]' \
12+		'-a[abort stack rebase]' \
13+		'-p[force push rebased branches]' \
14+		'1::base branch:__git_branch_names'
15+}
16+
17+__git_branch_names() {
18+	local branches
19+	branches=(${${(f)"$(git branch --format='%(refname:short)' 2>/dev/null)"}})
20+	compadd -a branches
21+}