2 * Copyright © 2012, 2020 Nick Bowler
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
32 print_option_start(const struct option *opt, const char *argname)
39 if (opt->val >= CHAR_MIN && opt->val <= CHAR_MAX) {
40 switch (opt->has_arg) {
42 w = printf(_(" -%c, --%s"), opt->val, opt->name);
45 w = printf(_(" -%c, --%s=%s"),
46 opt->val, opt->name, argname);
49 w = printf(_(" -%c, --%s[=%s]"),
50 opt->val, opt->name, argname);
56 switch (opt->has_arg) {
58 w = printf(_(" --%s"), opt->name);
61 w = printf(_(" --%s=%s"), opt->name, argname);
64 w = printf(_(" --%s[=%s]"), opt->name, argname);
79 struct cdecl_declspec;
82 void *malloc_nofail(size_t size);
83 void *realloc_nofail(void *ptr, size_t size);
84 void test_print_specifiers(struct cdecl_declspec *spec);
85 void test_print_decl(struct cdecl *decl);
86 void test_explain_decl(struct cdecl *decl);
88 bool strict_strtoul(unsigned long *val, const char *str, int base);
90 void test_print_version(const char *program);