1 # $NetBSD: opttest,v 1.2 2007/07/05 16:05:40 ginsbach Exp $
3 # GNU libc tests with these
7 longopt: required, required_argument, , 'r'
8 longopt: optional, optional_argument, , 'o'
9 longopt: none, no_argument, , 'n'
10 longopt: color, no_argument, , 'C'
11 longopt: colour, no_argument, , 'C'
13 args: foo --req foobar
14 result: -required=foobar|0
16 args: foo --opt=bazbug
17 result: -optional=bazbug|0
19 # This is promblematic
21 # GNU libc 2.1.3 this fails with ambiguous
23 # GNU libc 2.2 >= this works
29 # This is the real GNU libc test!
30 args: foo -a -b -cfoobar --required foobar --optional=bazbug --none random \
31 --col --color --colour
32 # GNU libc 2.1.3 this fails with ambiguous
33 #result: a,b,c=foobar,-required=foobar,-optional=bazbug,-none,!?,-color,-colour|1
34 # GNU libc 2.2 >= this works
35 result: a,b,c=foobar,-required=foobar,-optional=bazbug,-none,-color,-color,-colour|1
37 # The order of long options in the long option array should not matter.
38 # An exact match should never be treated as ambiguous.
42 longopt: list-foobar, no_argument, lopt, 'f'
43 longopt: list-goobar, no_argument, lopt, 'g'
44 longopt: list, no_argument, lopt, 'l'