git: do not track vim swo temp file.
[dabba.git] / dabbad / help.c
blob346ba3fc5b61bcf5dbf581b93e4bf593ad4bdcab
1 /**
2 * \file help.c
3 * \author written by Emmanuel Roullit emmanuel.roullit@gmail.com (c) 2013
4 * \date 2013
5 */
8 #include <stdio.h>
9 #include <assert.h>
10 #include <getopt.h>
12 static const char _usage[] =
13 "usage: dabbad [<args>]\n\n" "The available options are:\n";
15 /**
16 * \brief Show dabbad usage options
17 * \param[in] opt Pointer to option structure array
20 void show_usage(const struct option *opt)
22 assert(opt);
24 printf("%s", _usage);
26 if (opt != NULL) {
27 while (opt->name != NULL) {
28 printf(" --%s", opt->name);
29 if (opt->has_arg == required_argument)
30 printf(" <arg>\n");
31 else if (opt->has_arg == optional_argument)
32 printf(" [arg]\n");
33 else
34 printf("\n");
35 opt++;
40 /**
41 * \brief Show current \c dabbad version on \c stdout
42 * \return Always returns 0.
45 int print_version(void)
47 printf("dabbad version %s\n", DABBA_VERSION);
48 return 0;