]>
Commit | Line | Data |
---|---|---|
e1033436 JS |
1 | #!/bin/sh |
2 | ||
3 | test_description='test git rev-parse --parseopt' | |
4 | . ./test-lib.sh | |
5 | ||
6 | cat > expect.err <<EOF | |
7 | usage: some-command [options] <args>... | |
44d86e91 | 8 | |
e1033436 JS |
9 | some-command does foo and bar! |
10 | ||
11 | -h, --help show the help | |
12 | --foo some nifty option --foo | |
13 | --bar ... some cool option --bar with an argument | |
14 | ||
15 | An option group Header | |
6422f633 | 16 | -C[...] option C with an optional argument |
e1033436 JS |
17 | |
18 | Extras | |
19 | --extra1 line above used to cause a segfault but no longer does | |
20 | ||
21 | EOF | |
22 | ||
23 | test_expect_success 'test --parseopt help output' ' | |
24 | git rev-parse --parseopt -- -h 2> output.err <<EOF | |
25 | some-command [options] <args>... | |
26 | ||
27 | some-command does foo and bar! | |
28 | -- | |
29 | h,help show the help | |
30 | ||
31 | foo some nifty option --foo | |
32 | bar= some cool option --bar with an argument | |
33 | ||
34 | An option group Header | |
35 | C? option C with an optional argument | |
36 | ||
37 | Extras | |
38 | extra1 line above used to cause a segfault but no longer does | |
39 | EOF | |
3af82863 | 40 | test_cmp expect.err output.err |
e1033436 JS |
41 | ' |
42 | ||
43 | test_done |