1#!/bin/sh23test_description='test git rev-parse --parseopt'4. ./test-lib.sh56cat > expect.err <<EOF7usage: some-command [options] <args>...89some-command does foo and bar!1011-h, --help show the help12--foo some nifty option --foo13--bar ... some cool option --bar with an argument1415An option group Header16-C[...] option C with an optional argument1718Extras19--extra1 line above used to cause a segfault but no longer does2021EOF2223test_expect_success 'test --parseopt help output' '24git rev-parse --parseopt -- -h 2> output.err <<EOF25some-command [options] <args>...2627some-command does foo and bar!28--29h,help show the help3031foo some nifty option --foo32bar= some cool option --bar with an argument3334An option group Header35C? option C with an optional argument3637Extras38extra1 line above used to cause a segfault but no longer does39EOF40test_cmp expect.err output.err41'4243test_done