3 # Copyright (C) 2006-2017 Free Software Foundation, Inc.
4 # This file is part of the GNUlib Library.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <https://www.gnu.org/licenses/>. */
25 # If argp was compiled without base_name, it will display full program name.
26 # If run on mingw, it will display the program name with a .exe suffix.
28 s,: [^ ]*/test-argp,: test-argp,
29 s,: test-argp\.exe,: test-argp,
30 }' | LC_ALL
=C
tr -d '\r' |
diff -c $TMP -
36 Usage: test-argp [-tvCSOlp?V] [-f FILE] [-r FILE] [-o[ARG]] [--test]
37 [--file=FILE] [--input=FILE] [--read=FILE] [--verbose] [--cantiga]
38 [--sonet] [--option] [--optional[=ARG]] [--many] [--one] [--two]
39 [--limerick] [--poem] [--help] [--usage] [--version] ARGS...
42 .
/test-argp
$EXEEXT --usage | func_compare || ERR
=1
45 # Test working usage-indent format
48 Usage: test-argp [-tvCSOlp?V] [-f FILE] [-r FILE] [-o[ARG]] [--test]
49 [--file=FILE] [--input=FILE] [--read=FILE] [--verbose] [--cantiga] [--sonet]
50 [--option] [--optional[=ARG]] [--many] [--one] [--two] [--limerick] [--poem]
51 [--help] [--usage] [--version] ARGS...
54 ARGP_HELP_FMT
='usage-indent=0' .
/test-argp
$EXEEXT --usage | func_compare || ERR
=1
59 Usage: test-argp [OPTION...] ARGS...
66 -f, -r, --file=FILE, --input=FILE, --read=FILE
67 Option with a mandatory argument
68 -v, --verbose Simple option without arguments
71 -C, --cantiga create a cantiga
72 -S, --sonet create a sonet
75 -O, --option An option
77 -o, --optional[=ARG] Option with an optional argument. ARG is one of
85 -l, --limerick create a limerick
86 -p, --poem create a poem
88 -?, --help give this help list
89 --usage give a short usage message
90 -V, --version print program version
92 Mandatory or optional arguments to long options are also mandatory or optional
93 for any corresponding short options.
98 # Compare --help output, but filter out any bug-reporting email address.
99 .
/test-argp
$EXEEXT --help \
100 |
sed 's/^\(Report bugs to \)<[^>]*>.$/\1<>./' | func_compare || ERR
=1
103 # Test ambiguous option handling
105 .
/test-argp
$EXEEXT --optio 2>/dev
/null
&& ERR
=1
109 .
/test-argp
$EXEEXT || ERR
=1