Skip to content

Commit 5b96d53

Browse files
authored
git-completion: complete aliases, too! (#1221)
1 parent f074325 commit 5b96d53

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

custom-completions/git/git-completions.nu

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,16 @@ def "nu-complete git files-or-refs" [] {
274274
| append (nu-complete git built-in-refs)
275275
}
276276

277+
def "nu-complete git aliases" [] {
278+
^git config --get-regexp ^alias\.
279+
| lines
280+
| parse "alias.{value} {description}"
281+
}
282+
277283
def "nu-complete git subcommands" [] {
278284
^git help -a | lines | where $it starts-with " " | parse -r '\s*(?P<value>[^ ]+) \s*(?P<description>\w.*)'
285+
| append (nu-complete git aliases)
286+
| uniq-by value
279287
}
280288

281289
def "nu-complete git add" [] {

0 commit comments

Comments
 (0)