git-config: don't silently ignore options after --list

Error out if someone gives options after --list since that is
not a valid syntax.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Frank Lichtenheld 2007-10-05 22:16:44 +02:00 committed by Shawn O. Pearce
parent 304b5af64f
commit a72c874e43

View File

@ -172,8 +172,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)
type = T_INT;
else if (!strcmp(argv[1], "--bool"))
type = T_BOOL;
else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l"))
else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l")) {
if (argc != 2)
usage(git_config_set_usage);
return git_config(show_all_config);
}
else if (!strcmp(argv[1], "--global")) {
char *home = getenv("HOME");
if (home) {