3 # Copyright (C) 2006 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 sed '1{s,: [^ ]*/test-argp,: test-argp,;}' | cmp - $TMP
33 Usage: test-argp [-tvO?V] [-f FILE] [-o[ARG]] [--test] [--file=FILE]
34 [--input=FILE] [--verbose] [--optional[=ARG]] [--option] [--help]
35 [--usage] [--version] ARGS...
38 ./test-argp --usage | func_compare || ERR=1
41 # Test working usage-indent format
44 Usage: test-argp [-tvO?V] [-f FILE] [-o[ARG]] [--test] [--file=FILE]
45 [--input=FILE] [--verbose] [--optional[=ARG]] [--option] [--help] [--usage]
49 ARGP_HELP_FMT='usage-indent=0' ./test-argp --usage | func_compare || ERR=1
54 Usage: test-argp [OPTION...] ARGS...
61 -f, --file=FILE, --input=FILE Option with a mandatory argument
62 -v, --verbose Simple option without arguments
65 -o, --optional[=ARG] Option with an optional argument. ARG is one of
67 -O, --option An option
73 -?, --help Give this help list
74 --usage Give a short usage message
75 -V, --version Print program version
77 Mandatory or optional arguments to long options are also mandatory or optional
78 for any corresponding short options.
83 ./test-argp --help | func_compare || ERR=1
86 # Test ambiguous option handling
88 ./test-argp --optio 2>/dev/null && ERR=1