Thread (7 messages) flat view 7 messages, 2 authors, 2016-06-15

Re: [PATCH 1/4] fix whitespace violations in test scripts

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:44
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Jeff King [off-list ref] writes:
quoted hunk
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
index d24a47d..7cdd70a 100755
--- a/t/t1502-rev-parse-parseopt.sh
+++ b/t/t1502-rev-parse-parseopt.sh
@@ -5,7 +5,7 @@ test_description='test git rev-parse --parseopt'
 
 cat > expect.err <<EOF
 usage: some-command [options] <args>...
-    
+
     some-command does foo and bar!
 
     -h, --help            show the help
This part unfortunately falls into the same category as your [3/4].

---

 parse-options.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/parse-options.c b/parse-options.c
index acf3fe3..5e56bb5 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -312,8 +312,12 @@ void usage_with_options_internal(const char * const *usagestr,
 	fprintf(stderr, "usage: %s\n", *usagestr++);
 	while (*usagestr && **usagestr)
 		fprintf(stderr, "   or: %s\n", *usagestr++);
-	while (*usagestr)
-		fprintf(stderr, "    %s\n", *usagestr++);
+	while (*usagestr) {
+		if (**usagestr)
+			fprintf(stderr, "    %s", *usagestr);
+		putc('\n', stderr);
+		usagestr++;
+	}
 
 	if (opts->type != OPTION_GROUP)
 		fputc('\n', stderr);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help