From 47e9cd28f8a404a0d6293935252ddca5fc243931 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Sat, 12 Jun 2010 14:57:39 +0200 Subject: parseopt: wrap rev-parse --parseopt usage for eval consumption 9c7304e (print the usage string on stdout instead of stderr, 2010-05-17) broke rev-parse --parseopt: when run with -h, the usage notice on stdout ended up in the shell eval. Wrap the usage in a cat <<\EOF ... EOF block when printing to stdout. I do not expect any usage lines to ever start with EOF so this shouldn't be an undue burden. Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- t/t1502-rev-parse-parseopt.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh index 660487dc08..4346795855 100755 --- a/t/t1502-rev-parse-parseopt.sh +++ b/t/t1502-rev-parse-parseopt.sh @@ -3,7 +3,8 @@ test_description='test git rev-parse --parseopt' . ./test-lib.sh -cat > expect < expect <<\END_EXPECT +cat <<\EOF usage: some-command [options] ... some-command does foo and bar! @@ -19,6 +20,7 @@ Extras --extra1 line above used to cause a segfault but no longer does EOF +END_EXPECT cat > optionspec << EOF some-command [options] ... -- cgit v1.2.3