3 # Copyright (C) 2006-2007 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 2, or (at your option)
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 along
17 # with this program; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
26 # If argp was compiled without base_name, it will display full program name.
27 # If run on mingw, it will display the program name with a .exe suffix.
29 s,: [^ ]*/test-argp,: test-argp,
30 s,: test-argp\.exe,: test-argp,
37 Usage: test-argp [-tvCSOlp?V] [-f FILE] [-o[ARG]] [--test] [--file=FILE]
38 [--input=FILE] [--verbose] [--cantiga] [--sonet] [--option]
39 [--optional[=ARG]] [--limerick] [--poem] [--help] [--usage]
43 ./test-argp --usage | func_compare || ERR=1
46 # Test working usage-indent format
49 Usage: test-argp [-tvCSOlp?V] [-f FILE] [-o[ARG]] [--test] [--file=FILE]
50 [--input=FILE] [--verbose] [--cantiga] [--sonet] [--option] [--optional[=ARG]]
51 [--limerick] [--poem] [--help] [--usage] [--version] ARGS...
54 ARGP_HELP_FMT='usage-indent=0' ./test-argp --usage | func_compare || ERR=1
59 Usage: test-argp [OPTION...] ARGS...
66 -f, --file=FILE, --input=FILE Option with a mandatory argument
67 -v, --verbose Simple option without arguments
70 -C, --cantiga create a cantiga
71 -S, --sonet create a sonet
74 -O, --option An option
76 -o, --optional[=ARG] Option with an optional argument. ARG is one of
84 -l, --limerick create a limerick
85 -p, --poem create a poem
87 -?, --help give this help list
88 --usage give a short usage message
89 -V, --version print program version
91 Mandatory or optional arguments to long options are also mandatory or optional
92 for any corresponding short options.
97 ./test-argp --help | func_compare || ERR=1
100 # Test ambiguous option handling
102 ./test-argp --optio 2>/dev/null && ERR=1