@matheusbsbs / matheus-bagliano / commits / 4751f11224
Fork 0

Show usage string for 'git stripspace -h'

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed Nov 9, 2009 at 09:04 UTC 4751f11224600ab25adb0a200fec55a734bc2936
1 file changed +3 -1
builtin-stripspace.c
+3 -1
@@ -73,9 +73,11 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
73 struct strbuf buf = STRBUF_INIT;
74 int strip_comments = 0;
75
76 - if (argc > 1 && (!strcmp(argv[1], "-s") ||
76 + if (argc == 2 && (!strcmp(argv[1], "-s") ||
77 !strcmp(argv[1], "--strip-comments")))
78 strip_comments = 1;
79 + else if (argc > 1)
80 + usage("git stripspace [-s | --strip-comments] < <stream>");
81
82 if (strbuf_read(&buf, 0, 1024) < 0)
83 die_errno("could not read the input");