[EShell] Fix completion for git

Search string was not up-to-date anymore, and comments behind actual commands
have changed.
This commit is contained in:
Daniel - 2018-12-09 14:55:52 +01:00
parent 8950a3e8ab
commit 2be4970d2a
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 2 additions and 5 deletions

View File

@ -57,14 +57,11 @@
(if (not (zerop (call-process "git" nil (current-buffer) nil "help" "--all")))
(warn "Cannot call `git to obtain list of available commands; completion wont be available.")
(goto-char 0)
(search-forward "available git commands in")
(let (commands)
(while (re-search-forward
"^[[:blank:]]+\\([[:word:]-.]+\\)[[:blank:]]*\\([[:word:]-.]+\\)?"
"^[[:blank:]]\\{3\\}\\([[:word:]-.]+\\)[[:blank:]]+"
nil t)
(push (match-string 1) commands)
(when (match-string 2)
(push (match-string 2) commands)))
(push (match-string 1) commands))
(sort commands #'string<)))))
(defconst pcmpl-git-commands (pcmpl-git-commands)