X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-stripspace.c;h=4d3b93fedb5f2eca68edca15ca1e10cb60176d36;hb=9c8398f0c9d1fc92df5c1a7a52c810294d8ac3f8;hp=1fd2205d530ad510a18ff5a441ca7b5cb1cc34a6;hpb=958742ba43a0e3847cc7095869f0d96febe47132;p=git.git diff --git a/builtin-stripspace.c b/builtin-stripspace.c index 1fd2205d5..4d3b93fed 100644 --- a/builtin-stripspace.c +++ b/builtin-stripspace.c @@ -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] < "); if (strbuf_read(&buf, 0, 1024) < 0) die_errno("could not read the input");