Code

strbuf_add_wrapped_text(): factor out strbuf_add_indented_text()
[git.git] / builtin-stripspace.c
index d6e3896c006796ccca12c00de45e36583387f05b..4d3b93fedb5f2eca68edca15ca1e10cb60176d36 100644 (file)
@@ -73,12 +73,14 @@ 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("could not read the input");
+               die_errno("could not read the input");
 
        stripspace(&buf, strip_comments);