aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_getopt_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-01-24 13:26:12 +0000
committerChristian Grothoff <christian@grothoff.org>2011-01-24 13:26:12 +0000
commit0c3a242667e7b70123fd431bcf955e1b357478c7 (patch)
tree978b09854345fd29a4136c8d76519bb342d8a7c9 /src/include/gnunet_getopt_lib.h
parent42bc0e67cb5a3547300b0c1d9feef69611723800 (diff)
downloadgnunet-0c3a242667e7b70123fd431bcf955e1b357478c7.tar.gz
gnunet-0c3a242667e7b70123fd431bcf955e1b357478c7.zip
docu
Diffstat (limited to 'src/include/gnunet_getopt_lib.h')
-rw-r--r--src/include/gnunet_getopt_lib.h31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h
index 148b8955c..8691fba2f 100644
--- a/src/include/gnunet_getopt_lib.h
+++ b/src/include/gnunet_getopt_lib.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009 Christian Grothoff (and other contributing authors) 3 (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2011 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -137,52 +137,67 @@ struct GNUNET_GETOPT_CommandLineOption
137 137
138/** 138/**
139 * Macro defining the option to print the command line 139 * Macro defining the option to print the command line
140 * help text. 140 * help text (-h option).
141 * 141 *
142 * @param about string with brief description of the application 142 * @param about string with brief description of the application
143 */ 143 */
144#define GNUNET_GETOPT_OPTION_HELP(about) \ 144#define GNUNET_GETOPT_OPTION_HELP(about) \
145 { 'h', "help", (const char *) NULL, gettext_noop("print this help"), 0, &GNUNET_GETOPT_format_help_, (void *) about } 145 { 'h', "help", (const char *) NULL, gettext_noop("print this help"), 0, &GNUNET_GETOPT_format_help_, (void *) about }
146 146
147
147/** 148/**
148 * Macro defining the option to print the version of 149 * Macro defining the option to print the version of
149 * the application 150 * the application (-v option)
150 * 151 *
151 * @param version string with the version number 152 * @param version string with the version number
152 */ 153 */
153#define GNUNET_GETOPT_OPTION_VERSION(version) \ 154#define GNUNET_GETOPT_OPTION_VERSION(version) \
154 { 'v', "version", (const char *) NULL, gettext_noop("print the version number"), 0, &GNUNET_GETOPT_print_version_, (void *) version } 155 { 'v', "version", (const char *) NULL, gettext_noop("print the version number"), 0, &GNUNET_GETOPT_print_version_, (void *) version }
155 156
157
156/** 158/**
157 * Get the log level 159 * Allow user to specify log file name (-l option)
160 *
161 * @param logfn set to the name of the logfile
158 */ 162 */
159#define GNUNET_GETOPT_OPTION_LOGFILE(logfn) \ 163#define GNUNET_GETOPT_OPTION_LOGFILE(logfn) \
160 { 'l', "logfile", "LOGFILE", gettext_noop("configure logging to write logs to LOGFILE"), 1, &GNUNET_GETOPT_set_string, (void *) logfn } 164 { 'l', "logfile", "LOGFILE", gettext_noop("configure logging to write logs to LOGFILE"), 1, &GNUNET_GETOPT_set_string, (void *) logfn }
161 165
166
162/** 167/**
163 * Set the configuration option for logging. 168 * Allow user to specify log level (-L option)
169 *
170 * @param loglev set to the log level
164 */ 171 */
165#define GNUNET_GETOPT_OPTION_LOGLEVEL(loglev) \ 172#define GNUNET_GETOPT_OPTION_LOGLEVEL(loglev) \
166 { 'L', "log", "LOGLEVEL", gettext_noop("configure logging to use LOGLEVEL"), 1, &GNUNET_GETOPT_set_string, (void *) loglev } 173 { 'L', "log", "LOGLEVEL", gettext_noop("configure logging to use LOGLEVEL"), 1, &GNUNET_GETOPT_set_string, (void *) loglev }
167 174
175
168/** 176/**
169 * Get number of verbose flags 177 * Get number of verbose (-V) flags
178 *
179 * @param level where to store the verbosity level (should be an 'int')
170 */ 180 */
171#define GNUNET_GETOPT_OPTION_VERBOSE(level) \ 181#define GNUNET_GETOPT_OPTION_VERBOSE(level) \
172 { 'V', "verbose", (const char *) NULL, gettext_noop("be verbose"), 0, &GNUNET_GETOPT_increment_value, (void *) level } 182 { 'V', "verbose", (const char *) NULL, gettext_noop("be verbose"), 0, &GNUNET_GETOPT_increment_value, (void *) level }
173 183
184
174/** 185/**
175 * Get configuration file name 186 * Get configuration file name (-c option)
187 *
188 * @param fn set to the configuration file name
176 */ 189 */
177#define GNUNET_GETOPT_OPTION_CFG_FILE(fn) \ 190#define GNUNET_GETOPT_OPTION_CFG_FILE(fn) \
178 { 'c', "config", "FILENAME", gettext_noop("use configuration file FILENAME"), 1, &GNUNET_GETOPT_set_string, (void *) fn } 191 { 'c', "config", "FILENAME", gettext_noop("use configuration file FILENAME"), 1, &GNUNET_GETOPT_set_string, (void *) fn }
179 192
193
180/** 194/**
181 * Marker to end the list of options. 195 * Marker for the end of the list of options.
182 */ 196 */
183#define GNUNET_GETOPT_OPTION_END \ 197#define GNUNET_GETOPT_OPTION_END \
184 { '\0', NULL, NULL, NULL, 0, NULL, NULL } 198 { '\0', NULL, NULL, NULL, 0, NULL, NULL }
185 199
200
186/** 201/**
187 * Parse the command line. 202 * Parse the command line.
188 * 203 *