Fixed variable const qualifiers.
[dabba.git] / dabbad / help.c
blob374a1f15f8aec622fb9229c8690e881ea2a17966
1 /**
2 * \file help.c
3 * \author written by Emmanuel Roullit emmanuel.roullit@gmail.com (c) 2012
4 * \date 2012
5 */
7 /* __LICENSE_HEADER_BEGIN__ */
9 /*
10 * Copyright (C) 2012 Emmanuel Roullit <emmanuel.roullit@gmail.com>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or (at
15 * your option) any later version.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
28 /* __LICENSE_HEADER_END__ */
30 #include <stdio.h>
31 #include <assert.h>
32 #include <getopt.h>
34 static const char _usage[] =
35 "usage: dabbad [<args>]\n\n" "The available options are:\n";
37 /**
38 * \brief Show dabbad usage options
41 void show_usage(const struct option * opt)
43 assert(opt);
45 printf("%s", _usage);
47 if (opt != NULL) {
48 while (opt->name != NULL) {
49 printf(" --%s", opt->name);
50 if (opt->has_arg == required_argument)
51 printf(" <arg>\n");
52 else if (opt->has_arg == optional_argument)
53 printf(" [arg]\n");
54 else
55 printf("\n");
56 opt++;