* [PATCH] _git-config: Complete unknown options from 'git help -c'.
@ 2019-09-30 16:51 Daniel Shahaf
0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2019-09-30 16:51 UTC (permalink / raw)
To: zsh-workers
---
Completion/Unix/Command/_git | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 29fa379a7..873b13e5b 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -2886,9 +2886,16 @@ __git_config_option-or-value () {
declare -a git_present_options # 'present' is an adjective
git_present_options=(
${${${(0)"$(_call_program gettable-options git config -z --list)"}%%$'\n'*}//:/\\:}
+
+ # Remove the "'git help config' for more information" line.
+ #
+ # Change literal 'foo.<bar>.baz' to 'foo.*.baz'. With that, completing
+ # at foo.lorem.<TAB> will offer foo.lorem.baz.
+ ${${${(f)"$(_call_program all-known-options "git help -c")"}:#* *}/<*>/*}
)
- # Add to $git_options options from the config file that aren't already in $git_options.
+ # Add to $git_options options from the config file, and from 'git help -c',
+ # that aren't already in $git_options.
() {
local -a -U sections_that_permit_arbitrary_subsection_names=(
alias
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-09-30 16:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30 16:51 [PATCH] _git-config: Complete unknown options from 'git help -c' Daniel Shahaf
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).