d453a53eb2b72de0a559902f93e80f04a8add654
[strongswan.git] / src / charon-cmd / cmd / cmd_options.h
1 /*
2 * Copyright (C) 2013 Martin Willi
3 * Copyright (C) 2013 revosec AG
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 * @defgroup cmd_option cmd_option
18 * @{ @ingroup cmd
19 */
20
21 #ifndef CMD_OPTION_H_
22 #define CMD_OPTION_H_
23
24 typedef struct cmd_option_t cmd_option_t;
25 typedef enum cmd_option_type_t cmd_option_type_t;
26
27 /**
28 * Command line options
29 */
30 enum cmd_option_type_t {
31 CMD_OPT_HELP,
32 CMD_OPT_VERSION,
33
34 CMD_OPT_COUNT
35 };
36
37 /**
38 * Command line arguments, similar to "struct option", but with descriptions
39 */
40 struct cmd_option_t {
41 /** option identifier */
42 cmd_option_type_t id;
43 /** long option name */
44 const char *name;
45 /** takes argument */
46 int has_arg;
47 /** decription of argument */
48 const char *arg;
49 /** description to option */
50 const char *desc;
51 };
52
53 /**
54 * Registered CMD options.
55 */
56 extern cmd_option_t cmd_options[CMD_OPT_COUNT];
57
58 #endif /** CMD_OPTION_H_ @}*/