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>
Frank Lichtenheld committed
Oct 5, 2007 at 22:16 UTC
a72c874e43e89a879fc4a8998ecd6e5a56667929
1 file changed
+4
-1
builtin-config.c
+4
-1
@@ -172,8 +172,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)
172
type = T_INT;
173
else if (!strcmp(argv[1], "--bool"))
174
type = T_BOOL;
175
- else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l"))
175
+ else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l")) {
176
+ if (argc != 2)
177
+ usage(git_config_set_usage);
178
return git_config(show_all_config);
179
+ }
180
else if (!strcmp(argv[1], "--global")) {
181
char *home = getenv("HOME");
182
if (home) {