]>
jfr.im git - irc/thales.git/blob - src/cmd.c
748bfd9efd814c5b40f4cefde330314f66f68f6b
9 printf_option(const char *option
, const char *description
)
11 printf(" %-20s%-20s\n", option
, description
);
16 printf("Usage: thales [options]\n");
17 printf_option("--help, -h", "Display this information");
18 printf_option("--version, -v", "Display thales version");
19 printf_option("--debug, -d", "Enable output of debug information");
20 printf_option("--config, -C", "Override default configuration file");
27 puts("Copyright (C) 2012 Free Software Foundation, Inc.");
28 puts("This is free software; see the source for copying conditions. There is NO");
29 puts("warranty; not even for MERCHANTABILITY "
30 "or FITNESS FOR A PARTICULAR PURPOSE.");
34 parse_cmdopts(struct cmd_options
*opts
, int argc
, char **argv
)
37 const char *optstr
= "hvdC:";
38 struct option longopts
[] = {
39 {"help", no_argument
, NULL
, 'h'},
40 {"version", no_argument
, NULL
, 'v'},
41 {"config", required_argument
, NULL
, 'C'},
42 {"debug", no_argument
, &opts
->debug
, 'd'}
44 while ((val
= getopt_long(argc
, argv
, optstr
, longopts
, NULL
))!= EOF
)
54 opts
->conf_filename
= optarg
;