2 * option.h: Library for interactive commandline interfaces
4 * Copyright (C) 2009 Matthias Bolte <matthias.bolte@googlemail.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __VSC_CLI__OPTION_H__
22 #define __VSC_CLI__OPTION_H__
26 #define VSC_CLI__NULL__OPTION_INFO \
27 { -1, NULL, NULL, VSC_CLI__OPTION_TYPE__UNDEFINED, \
28 VSC_CLI__OPTION_FLAG__NONE }
30 #define VSC_CLI__VERBOSE_ERRORS__OPTION_INFO__LONG_NAME "verbose-errors"
31 #define VSC_CLI__VERBOSE_ERRORS__OPTION_INFO \
32 { -1, VSC_CLI__VERBOSE_ERRORS__OPTION_INFO__LONG_NAME, \
33 "Enable verbose error reporting", \
34 VSC_CLI__OPTION_TYPE__BOOLEAN, VSC_CLI__OPTION_FLAG__TAGGED }
36 #define VSC_CLI__NO_COLOR__OPTION_INFO__LONG_NAME "no-color"
37 #define VSC_CLI__NO_COLOR__OPTION_INFO \
38 { -1, VSC_CLI__NO_COLOR__OPTION_INFO__LONG_NAME, \
39 "Disable output coloring", \
40 VSC_CLI__OPTION_TYPE__BOOLEAN, VSC_CLI__OPTION_FLAG__TAGGED }
46 const struct VscCliOption *
47 vsc_cli_option_list_lookup (const struct VscCliOption *option_list,
48 const char *option_long_name);
51 vsc_cli_option_list_lookup_boolean (const struct VscCliOption *option_list,
52 const char *option_long_name);
55 vsc_cli_option_list_lookup_number (const struct VscCliOption *option_list,
56 const char *option_long_name, int *found);
59 vsc_cli_option_list_lookup_string (const struct VscCliOption *option_list,
60 const char *option_long_name);
63 vsc_cli_option_list_free (struct VscCliOption **option_list);
69 #endif /* __VSC_CLI__OPTION_H__ */