aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorDavid M. Syzdek <david@syzdek.net>2022-03-24 16:39:42 -0800
committerDavid M. Syzdek <david@syzdek.net>2022-03-24 16:39:42 -0800
commit2c43afc0507f5e1558421656492e7ead9addc59d (patch)
tree063203a22eb3b021a237dd11ae4f949f7d8249d8 /src
parentbfcb165b301b4b30953f1de49206fc458f2eb0c1 (diff)
downloadtinyrad-2c43afc0507f5e1558421656492e7ead9addc59d.tar.gz
tinyrad-2c43afc0507f5e1558421656492e7ead9addc59d.tar.bz2
tinyrad-2c43afc0507f5e1558421656492e7ead9addc59d.tar.xz
tinyrad-2c43afc0507f5e1558421656492e7ead9addc59d.zip
tinyrad: cleaning up tru_widget_map[]
Diffstat (limited to 'src')
-rw-r--r--src/tinyrad.c70
1 files changed, 40 insertions, 30 deletions
diff --git a/src/tinyrad.c b/src/tinyrad.c
index 4998e65..2ae75eb 100644
--- a/src/tinyrad.c
+++ b/src/tinyrad.c
@@ -206,41 +206,51 @@ tru_usage(
206static const TinyRadUtilWidget tru_widget_map[] = 206static const TinyRadUtilWidget tru_widget_map[] =
207{ 207{
208 { 208 {
209 "configuration", // command name 209 .name = "configuration",
210 &tru_widget_config, // entry function 210 .func = &tru_widget_config,
211 TINYRAD_DICT_GETOPT_SHORT 211 .shortopts = TINYRAD_DICT_GETOPT_SHORT TINYRAD_GETOPT_SHORT,
212 TINYRAD_GETOPT_SHORT, // getopt short options 212 .longopts = (struct option [])
213 (struct option []) 213 { TINYRAD_DICT_GETOPT_LONG
214 { TINYRAD_DICT_GETOPT_LONG 214 TINYRAD_GETOPT_LONG
215 TINYRAD_GETOPT_LONG 215 },
216 }, // getopt long options 216 .min_arg = 0,
217 0, 0, // min/max arguments 217 .max_arg = 0,
218 NULL, // extra cli usage 218 .usage = NULL,
219 "print configuration" // command description 219 .desc = "print configuration"
220 }, 220 },
221 { 221 {
222 "dictionary", // command name 222 .name = "dictionary",
223 &tru_widget_dict, // entry function 223 .func = &tru_widget_dict,
224 TINYRAD_DICT_GETOPT_SHORT 224 .shortopts = TINYRAD_DICT_GETOPT_SHORT TINYRAD_GETOPT_SHORT,
225 TINYRAD_GETOPT_SHORT, // getopt short options 225 .longopts = (struct option [])
226 (struct option []) 226 { TINYRAD_DICT_GETOPT_LONG
227 { TINYRAD_DICT_GETOPT_LONG 227 TINYRAD_GETOPT_LONG
228 TINYRAD_GETOPT_LONG 228 },
229 }, // getopt long options 229 .min_arg = 0,
230 0, 0, // min/max arguments 230 .max_arg = 0,
231 NULL, // extra cli usage 231 .usage = NULL,
232 "print processed dictionary" // command description 232 .desc = "print processed dictionary"
233 }, 233 },
234 { 234 {
235 "help", // command name 235 .name = "help",
236 &tru_usage, // entry function 236 .func = &tru_usage,
237 TINYRAD_GETOPT_SHORT, // getopt short options 237 .shortopts = TINYRAD_GETOPT_SHORT,
238 (struct option []) { TINYRAD_GETOPT_LONG }, // getopt long options 238 .longopts = (struct option []) { TINYRAD_GETOPT_LONG },
239 0, 0, // min/max arguments 239 .min_arg = 0,
240 NULL, // extra cli usage 240 .max_arg = 0,
241 "print command usage" // command description 241 .usage = NULL,
242 .desc = "print command usage"
242 }, 243 },
243 { NULL, NULL, NULL, NULL, -1, -1, NULL, NULL } 244 {
245 .name = NULL,
246 .func = NULL,
247 .shortopts = NULL,
248 .longopts = NULL,
249 .min_arg = -1,
250 .max_arg = -1,
251 .usage = NULL,
252 .desc = NULL
253 }
244}; 254};
245 255
246 256