]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/shortlog.c
parse-options: do not show usage upon invalid option value
authorPaul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
Thu, 22 Mar 2018 18:43:51 +0000 (20:43 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Mar 2018 19:10:08 +0000 (12:10 -0700)
commit3bb0923f06c55ea44569f547cefa9e1a59069ff2
tree9667154be2d13f516298897c4b132191db38b6f4
parent38e79b1fdab9244e1727d0698afcf3bb8956c0a4
parse-options: do not show usage upon invalid option value

Usually, the usage should be shown only if the user does not know what
options are available. If the user specifies an invalid value, the user
is already aware of the available options. In this case, there is no
point in displaying the usage anymore.

This patch applies to "git tag --contains", "git branch --contains",
"git branch --points-at", "git for-each-ref --contains" and many more.

Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/blame.c
builtin/shortlog.c
builtin/update-index.c
parse-options.c
parse-options.h
t/t0040-parse-options.sh
t/t0041-usage.sh [new file with mode: 0755]
t/t3404-rebase-interactive.sh