From: Junio C Hamano Date: Tue, 3 Nov 2015 23:32:38 +0000 (-0800) Subject: Merge branch 'jc/usage-stdin' into maint X-Git-Tag: v2.6.3~20 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f5f76845961f4207b3dc8c186b2356f160276e45?ds=inline;hp=--cc Merge branch 'jc/usage-stdin' into maint The synopsis text and the usage string of subcommands that read list of things from the standard input are often shown as if they only take input from a file on a filesystem, which was misleading. * jc/usage-stdin: usage: do not insist that standard input must come from a file --- f5f76845961f4207b3dc8c186b2356f160276e45 diff --cc builtin/stripspace.c index a8b7a93b43,958567a0cd..7ff8434f7c --- a/builtin/stripspace.c +++ b/builtin/stripspace.c @@@ -13,17 -77,9 +13,17 @@@ static void comment_lines(struct strbu free(msg); } -static const char *usage_msg = "\n" -" git stripspace [-s | --strip-comments]\n" -" git stripspace [-c | --comment-lines]"; +static const char * const stripspace_usage[] = { - N_("git stripspace [-s | --strip-comments] < input"), - N_("git stripspace [-c | --comment-lines] < input"), ++ N_("git stripspace [-s | --strip-comments]"), ++ N_("git stripspace [-c | --comment-lines]"), + NULL +}; + +enum stripspace_mode { + STRIP_DEFAULT = 0, + STRIP_COMMENTS, + COMMENT_LINES +}; int cmd_stripspace(int argc, const char **argv, const char *prefix) {