2 std_init.c - MaLa standard module initialization table
4 Copyright (C) 2005, Christian Thaeter <chth@gmx.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, contact me.
27 mala_actioninit std_help
[] =
30 MALA_PARSER("--", mala__parser, NULL, NULL, NULL),
31 MALA_PARSER_BRIEF("--", ""),
32 MALA_PARSER_HELP("--", ("TODO")),
33 MALA_PARSER_SIGNATURE("--", ("")),
34 MALA_PARSER_RESULT("--", ("")),
37 MALA_MACRO_PARSER("--TYPE", ("--TYPE_%-1")),
38 MALA_PARSER_BRIEF("--TYPE", "Explains a type"),
39 MALA_PARSER_HELP("--TYPE", ("Mala has a lazy type system, by default everything is treated asd string. Type adding type information is optional, some extra tools will actually use it to do some useful things like command completion and so on.")),
40 MALA_PARSER_SIGNATURE_TYPE("--TYPE", ("TYPE")),
41 MALA_PARSER_RESULT_TYPE("--TYPE", ("VOID")),
42 MALA_PARSER_SIGNATURE_USAGE("--", ("Name of the type to explain")),
43 MALA_PARSER_RESULT_USAGE("--", ("")),
47 MALA_MACRO_PARSER("--SIGNATURE", ("--SIGNATURE_%-1")),
48 MALA_PARSER_BRIEF("--SIGNATURE", "Lists the options of a command"),
49 MALA_PARSER_HELP("--SIGNATURE", ("TODO")),
50 MALA_PARSER_SIGNATURE("--SIGNATURE", ("DEFINED-ACTION", "")),
51 MALA_PARSER_RESULT("--SIGNATURE", ("VOID")),
53 MALA_MACRO_PARSER("--RESULT", ("--RESULT_%-1")),
54 MALA_PARSER_BRIEF("--RESULT", "explains the result of a command"),
55 MALA_PARSER_HELP("--RESULT", ("TODO")),
56 MALA_PARSER_SIGNATURE("--RESULT", ("DEFINED-ACTION")),
57 MALA_PARSER_RESULT("--RESULT", ("VOID")),
60 MALA_MACRO_PARSER("--BRIEF", ("--BRIEF-ACTION", "--BRIEF_%-1")),
61 MALA_PARSER_BRIEF("--BRIEF", "gives a short note about a command"),
62 MALA_PARSER_HELP("--BRIEF", ("TODO")),
63 MALA_PARSER_SIGNATURE_TYPE("--BRIEF", ("DEFINED-ACTION")),
64 MALA_PARSER_RESULT_TYPE("--BRIEF", ("VOID")),
65 MALA_PARSER_SIGNATURE_USAGE("--", ("")),
66 MALA_PARSER_RESULT_USAGE("--", ("")),
69 applies an action to each word of a macro/expansion
70 usage: --FOREACH-WORD DEFINED-ACTION MACRO
72 DEFINED-ACTION - Action to be applied
73 MACRO - Macro consists of words on which the action should be appied
75 Expansion which applies the Action to the macro
78 MALA_MACRO_PARSER("--PRINT_SPACE", ("--PRINT", "--LITERAL", "%-1",
81 MALA_MACRO_PARSER("--HELP", ("--IFDEF", "--BRIEF_%-1",
83 "--PRINTL", "--BRIEF_%-1",
90 "--IFDEF", "--SIGNATURE_TYPE_%-1",
92 "--PRINT", "usage: %-1 ",
93 "--FOREACH-WORD","--LITERAL","--PRINT_SPACE",
94 "--SIGNATURE-TYPE_%-1",
98 "--IFDEF", "--SIGNATURE_USAGE_%-1",
101 "--PRINTL","parameters:",
102 // "--FOREACH-WORD","--LITERAL","--PRINT_SPACE",
103 //"--SIGNATURE-USAGE_%-1",
106 "--IFDEF", "--RESULT-TYPE_%-1",
108 "--PRINT","result [","--PRINT","--RESULT-TYPE_%-1",
112 "--IFDEF", "--RESULT-USAGE_%-1",
114 "--PRINT"," ","--PRINTL","--RESULT-USAGE_%-1",
115 "--PRINTL", "--HELP_%-1"
118 MALA_PARSER_BRIEF("--HELP", "gives help about some command"),
119 MALA_PARSER_HELP("--HELP", ("Any command in Mala might be associated with some buildin help, use --HELP --somecommand to show this help")),
120 MALA_PARSER_SIGNATURE_TYPE("--HELP", ("DEFINED-ACTION")),
121 MALA_PARSER_RESULT_TYPE("--HELP", ("VOID")),
122 MALA_PARSER_SIGNATURE_USAGE("--", ("")),
123 MALA_PARSER_RESULT_USAGE("--", ("")),
129 mala_module_std_help_init (MalaEngine self
)
131 return mala_engine_actions_register (self
, std_help
);
138 // c-file-style: "gnu"
140 // arch-tag: 5d28d2a3-4ceb-4d09-ab30-2912d0710fc8