Thread (115 messages) 115 messages, 4 authors, 2018-12-11

Re: [PATCH v2 01/41] parse-options: support --git-completion-helper

From: Eric Sunshine <hidden>
Date: 2018-01-31 20:23:21

On Wed, Jan 31, 2018 at 6:05 AM, Nguyễn Thái Ngọc Duy [off-list ref] wrote:
quoted hunk ↗ jump to hunk
This option is designed to be used by git-completion.bash. For many
simple cases, what we do in there is usually

    __gitcomp "lots of completion options"

which has to be manually updated when a new user-visible option is
added. With support from parse-options, we can write

    __gitcomp "$(git command --git-completion-helper)"

and get that list directly from the parser for free. Dangerous/Unpopular
options could be hidden with the new "NOCOMPLETE" flag.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
diff --git a/parse-options.h b/parse-options.h
@@ -89,6 +90,8 @@ typedef int parse_opt_ll_cb(struct parse_opt_ctx_t *ctx,
+ *   PARSE_OPT_NOCOMPLETE: by default all visible options are completable
+ *                        git-completion.bash. This option suppresses that.
s/git-/by &/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help