fputc('\n', outfile);
if (!err && ctx && ctx->flags & PARSE_OPT_SHELL_EVAL)
- fputs("EOF\n", outfile);
+ fputs("EOF\nexit 0\n", outfile);
return err ? PARSE_OPT_HELP_ERROR : PARSE_OPT_HELP;
}
cat <<-\EOF &&
error: unknown option `'${opt#--}\''
EOF
- sed -e 1d -e \$d <"$TEST_DIRECTORY/t1502/$spec.help"
+ sed -e 1d -e /EOF/d -e \$d <"$TEST_DIRECTORY/t1502/$spec.help"
} >expect &&
test_expect_code 129 git rev-parse --parseopt -- $opt \
2>output <"$TEST_DIRECTORY/t1502/$spec" &&
| some-command does foo and bar!
|
|EOF
+|exit 0
END_EXPECT
test_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec_no_switches &&
test_cmp expect output
| some-command does foo and bar!
|
|EOF
+|exit 0
END_EXPECT
test_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec_only_hidden_switches &&
test_cmp expect output
| --[no-]hidden1 A hidden switch
|
|EOF
+|exit 0
END_EXPECT
test_expect_code 129 git rev-parse --parseopt -- --help-all > output < optionspec_only_hidden_switches &&
test_cmp expect output
cat <<-\EOF &&
error: unknown option `does-not-exist'\''
EOF
- sed -e 1d -e \$d <"$TEST_DIRECTORY/t1502/optionspec.help"
+ sed -e 1d -e /EOF/d -e \$d <"$TEST_DIRECTORY/t1502/optionspec.help"
} >expect &&
test_expect_code 129 git rev-parse --parseopt -- --does-not-exist 1>/dev/null 2>output < optionspec &&
test_cmp expect output
| -h, --help show the help
|
|EOF
+ |exit 0
END_EXPECT
test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
| -h, --help show the help
|
|EOF
+ |exit 0
END_EXPECT
test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
difftool--helper | filter-branch | format-rev | fsck-objects | \
get-tar-commit-id | \
gui | gui--askpass | \
- http-backend | http-fetch | http-push | init-db | \
+ http-backend | http-fetch | http-push | init-db | instaweb | \
merge-octopus | merge-one-file | merge-resolve | mergetool | \
- mktag | p4 | p4.py | pickaxe | remote-ftp | remote-ftps | \
- remote-http | remote-https | replay | send-email | \
+ mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \
+ remote-http | remote-https | replay | request-pull | send-email | \
sh-i18n--envsubst | shell | show | stage | submodule | svn | \
upload-archive--writer | upload-pack | web--browse | whatchanged)
expect_outcome=expect_failure ;;