diff options
| author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-02-09 18:01:42 +0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-02-09 10:24:50 -0800 |
| commit | 1224781d6080b8b69a81526ee23b22a1587920ea (patch) | |
| tree | 8b31c3cc26307351710d01d6b797d77101bb97b8 /builtin/worktree.c | |
| parent | 2de37349d9484fc51f45fe5dc9da56096b360221 (diff) | |
| download | git-1224781d6080b8b69a81526ee23b22a1587920ea.tar.xz | |
parse-options: let OPT__FORCE take optional flags argument
--force option is most likely hidden from command line completion for
safety reasons. This is done by adding an extra flag
PARSE_OPT_NOCOMPLETE. Update OPT__FORCE() to accept additional
flags. Actual flag change comes later depending on individual
commands.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/worktree.c')
| -rw-r--r-- | builtin/worktree.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c index 7cef5b120b..4d3422f62e 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -365,7 +365,9 @@ static int add(int ac, const char **av, const char *prefix) const char *branch; const char *opt_track = NULL; struct option options[] = { - OPT__FORCE(&opts.force, N_("checkout <branch> even if already checked out in other worktree")), + OPT__FORCE(&opts.force, + N_("checkout <branch> even if already checked out in other worktree"), + 0), OPT_STRING('b', NULL, &opts.new_branch, N_("branch"), N_("create a new branch")), OPT_STRING('B', NULL, &new_branch_force, N_("branch"), |
