]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Show usage string for 'git stripspace -h'
authorJonathan Nieder <jrnieder@gmail.com>
Mon, 9 Nov 2009 15:04:57 +0000 (09:04 -0600)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Nov 2009 19:06:57 +0000 (11:06 -0800)
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-stripspace.c

index 1fd2205d530ad510a18ff5a441ca7b5cb1cc34a6..4d3b93fedb5f2eca68edca15ca1e10cb60176d36 100644 (file)
@@ -73,9 +73,11 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
        struct strbuf buf = STRBUF_INIT;
        int strip_comments = 0;
 
-       if (argc > 1 && (!strcmp(argv[1], "-s") ||
+       if (argc == 2 && (!strcmp(argv[1], "-s") ||
                                !strcmp(argv[1], "--strip-comments")))
                strip_comments = 1;
+       else if (argc > 1)
+               usage("git stripspace [-s | --strip-comments] < <stream>");
 
        if (strbuf_read(&buf, 0, 1024) < 0)
                die_errno("could not read the input");