@matheusbsbs / matheus-bagliano / commits / 75a46f6b0e
Fork 0

write-tree: check extra arguments and die but be a bit more helpful.

"git-write-tree junk" complains and dies, but it does not say what option it supports. Die with the usage string in such a case. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Dec 5, 2005 at 22:30 UTC 75a46f6b0ed3c3aa6fe4ff53a8c20cb58cbb3732
1 file changed +3 -1
write-tree.c
+3 -1
@@ -83,6 +83,8 @@ static int write_tree(struct cache_entry **cachep, int maxentries, const char *b
83 return nr;
84 }
85
86 +static const char write_tree_usage[] = "git-write-tree [--missing-ok]";
87 +
88 int main(int argc, char **argv)
89 {
90 int i, funny;
@@ -96,7 +98,7 @@ int main(int argc, char **argv)
98 if (!strcmp(argv[1], "--missing-ok"))
99 missing_ok = 1;
100 else
99 - die("unknown option %s", argv[1]);
101 + die(write_tree_usage);
102 }
103
104 if (argc > 2)