summaryrefslogtreecommitdiff
path: root/src/i18n.c
blob: 245ad84cfb3cbf50e8b6aee3e713952892373252 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "i18n.h"

#ifdef TEST
#include "logerr.h"
#include "catalog.h"

#include <stdlib.h>
#endif

const char *const
MSGS[] = {
	"",
	[MSG_USAGE_FIRST]="Usage:\n",
	[MSG_USAGE_1]="  " NAME_MACRO_STRING " -p FILE [-o DIRECTORY]\n",
	[MSG_USAGE_2]="  " NAME_MACRO_STRING " -l FILE [-o DIRECTORY]\n",
	[MSG_USAGE_LAST]="  " NAME_MACRO_STRING " [-hV]\n",
	[MSG_HELP_FIRST]="\n",
	[MSG_HELP_1]="\n",
	[MSG_HELP_2]="Options:\n",
	[MSG_HELP_3]="  -p FILE          parser file to be processed\n",
	[MSG_HELP_4]="  -l FILE          lexer file to be processed\n",
	[MSG_HELP_5]="  -o DIRECTORY     output where to place the\n",
	[MSG_HELP_6]="                   generated files (default .)\n",
	[MSG_HELP_7]="  -h, --help       show this help message\n",
	[MSG_HELP_8]="  -V, --version    print the version number\n",
	[MSG_HELP_9]="\n",
	[MSG_HELP_10]="\n",
	[MSG_HELP_11]="Run the " NAME_MACRO_STRING "(1) parser program.\n",
	[MSG_HELP_12]="\n",
	[MSG_HELP_13]="Here is the explanation for what it does, and the synopsis\n",
	[MSG_HELP_14]="of its usage.\n",
	[MSG_HELP_15]="\n",
	[MSG_HELP_16]="See \"man " NAME_MACRO_STRING "\" for usage information and\n",
	[MSG_HELP_17]="\"man " NAME_MACRO_STRING ".tutorial\" for a beginner introduction.\n",
	[MSG_HELP_18]="\n",
	[MSG_HELP_19]="\n",
	[MSG_HELP_20]="Examples:\n",
	[MSG_HELP_21]="\n",
	[MSG_HELP_22]="  Do a one-line parser:\n",
	[MSG_HELP_23]="\n",
	[MSG_HELP_24]="    $ " NAME_MACRO_STRING " run md.grammar < README.md\n",
	[MSG_HELP_25]="\n",
	[MSG_HELP_26]="\n",
	[MSG_HELP_27]="  Compile the grammer:\n",
	[MSG_HELP_28]="\n",
	[MSG_HELP_LAST]="    $ " NAME_MACRO_STRING " build csv.grammar > dunno.alsodunno\n",
	[MSG_VERSION]= NAME_MACRO_STRING " " VERSION_MACRO_STRING " " DATE_MACRO_STRING "\n",
	NULL
};


#ifdef TEST
int
main(void) {
	int rc = 0;

	if (getenv("DUMP_TRANSLATABLE_STRINGS")) {
		if (dump_translatable_strings(MSGS)) {
			logerr("dump_translatable_strings(MSGS)\n");
			rc = -1;
			goto out;
		}
	}

out:
	return !!rc;
}
#endif