-
Notifications
You must be signed in to change notification settings - Fork 8
/
commandlinereference.htm
295 lines (294 loc) · 46.6 KB
/
commandlinereference.htm
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<!DOCTYPE HTML>
<html id="hs-topic-p">
<!-- saved from url=(0025)http://www.helpsmith.com/ -->
<head>
<title>Command Line Reference</title>
<meta charset="windows-1252" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="HelpSmith 9.4 (Build 22.705)" />
<style type="text/css" media="screen">
html {
overflow: hidden;
margin: 0;
padding: 0;
height: 100%;
}
body {
overflow: hidden;
margin: 0;
padding: 0;
height: 100%;
}
#non-scrolling-area {
padding: 0 10px 0 10px;
background-color: #5e5f5f;
}
#container {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
#content {
padding: 0 10px 5px 10px;
}
</style>
<link type="text/css" rel="stylesheet" href="../css/topics/style.css" />
<script type="text/javascript" src="../js/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="../js/nsa.js?0a86901a"></script>
<script type="text/javascript" src="../js/settings.js?f55a7ab4"></script>
<script type="text/javascript" src="../js/core.min.js?0a86901a"></script>
<script type="text/javascript" src="../js/topic.min.js?0a86901a"></script>
<script type="text/javascript">
var topicContext = 2180;
</script>
<!-- Web Help Topic -->
<!-- HTML Help (CHM) Topic -->
</head>
<body>
<div id="non-scrolling-area">
<h1 class="hd0"><span class="ts0">Command Line Reference</span></h1>
</div>
<div id="container">
<div id="content-background">
<div id="content">
<p> </p>
<p class="ps1"><span class="ts2">To generate code with CodeGen a developer goes to the operating system command prompt in an appropriately configured environment and issues codegen commands.</span></p>
<p class="ps1"><span class="ts2">As a minimum the developer must use the </span><a href="commandlinereference.htm#option_t" class="hs0">-t option</a><span class="ts2"> to specify the name of at least one template file to be used, and in almost all situations the </span><a href="commandlinereference.htm#option_s" class="hs0">-s option</a><span class="ts2"> is also used to specify one or more repository structures to be processed.</span></p>
<p class="ps1"><span class="ts2">There are several other command line options documented below. Some of the main ones are the </span><a href="commandlinereference.htm#option_r" class="hs0">-r option</a><span class="ts2"> which causes any existing output files to be replaced, and the </span><a href="commandlinereference.htm#option_v" class="hs0">-v option</a><span class="ts2"> which produces various information messages to be displayed as CodeGen generates code.</span></p>
<p class="ps1"><span class="ts2">For example, a developer might use a command like this:</span></p>
<p class="ps9"><span class="ts4">C:> codegen -t data_class -s customer -r -v</span></p>
<p class="ps1"><span class="ts2">This command would cause CodeGen to create an output file based on the code defined in the template file named data_class.tpl and using information from the repository structure named CUSTOMER. If the output file already exists then it will be overwritten, and verbose messages will be displayed.</span></p>
<p class="ps1"><span class="ts3"> </span><span class="ts4">codegen <options></span></p>
<h2 class="hd1"><span class="ts1">Commonly Used Command Line Options</span></h2>
<p class="ps1"><span class="ts2">These options are used almost every time CodeGen is used:</span></p>
<p class="ps1"><a id="option_s"></a><span class="ts4"> -s structure[.group] [...] | *</span></p>
<p class="ps10"><span class="ts2">Structure(s) to process. You must specify the name of at least one structure and may optionally specify multiple structure names separated by spaces. Alternatively you can specify the * wild-card to indicate that all structures are to be processed. It is also possible to generate a "pseudo structure" based on the fields within an implicit group within a structure.</span></p>
<p class="ps10"><span class="ts2">If you need to process a large number of structures you can use the -s option to specify a single </span><a href="structureinputfiles.htm" class="hs0">structure input file</a><span class="ts2"> that defines structure names, and also optionally </span><a href="commandlinereference.htm#option_a" class="hs0">structure alias</a><span class="ts2"> names and </span><a href="commandlinereference.htm#option_fo" class="hs0">file override</a><span class="ts2"> names.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.Structures property (List<String>).</span></p>
<p class="ps1"><a id="option_t"></a><span class="ts4"> -t [*]template [...]</span></p>
<p class="ps10"><span class="ts2">Template(s) to process. You must specify at least one template name, and may optionally specify multiple template names separated by spaces. Alternatively you can use the wild-card character * to specify that multiple templates should be processed (e.g. database*) or use the * wild-card alone to indicate that all templates should be processed.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.Templates property (List<String>).</span></p>
<p class="ps1"><a id="option_r"></a><span class="ts4"> -r</span></p>
<p class="ps10"><span class="ts2">Replace existing files. By default existing files are not replaced.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.ReplaceFiles property (Boolean)</span><br /> </p>
<h2 class="hd1"><span class="ts1">Other Command Line Options</span></h2>
<p class="ps1"><span class="ts2">These options can be used to modify how CodeGen works:</span></p>
<p class="ps1"><a id="option_a"></a><span class="ts4"> -a alias [...]]</span></p>
<p class="ps10"><span class="ts2">Structure aliases. A structure alias is an alternate name to be used to represent a structure. If -a is used then you must specify at least one alias name, and may optionally specify multiple alias names separated by spaces, up to but not exceeding the number of structure names that have been specified via the -s option. If you wish to omit an alias for a structure in the middle of the list then specify an empty string by passing two double quote characters.</span></p>
<p class="ps10"><span class="ts2">If you are using a </span><a href="structureinputfiles.htm" class="hs2">structure list input file</a><span class="ts2"> then aliases must be specified via that file.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.Aliases property (List<String>).</span></p>
<p class="ps1"><a id="option_af"></a><span class="ts4"> -af</span></p>
<p class="ps10"><span class="ts2">Alternate field names. When this option is used most field loop tokens that refer to the name of a field will return the ALTERNATE name if defined. If not define the actual name will continue to be returned.</span></p>
<p class="ps10"><span class="ts5">EXPERIMENTAL:</span><span class="ts2"> Enabling this option impacts a lot if things internally and it is possible that we may not have currently covered all use cases appropriately. Please report any 'strange behavior' you experience when using this option.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.UseAlternateFieldNames property (Boolean).</span></p>
<p class="ps1"><a id="option_as"></a><span class="ts4"> -as</span></p>
<p class="ps10"><span class="ts2">Alternate structure names. Enabling this option is similar to using structure aliasing, except that the structure names are derived from the alternate name (ODBC table name) associated with the first structure assignment of the first FILE definition that the current structure is associated with. If the structure is not assigned to a file, or the file does not have any assigned structures, or the first assigned structure does not have an associated ODBC table name, then the structures original name is retained.</span></p>
<p class="ps10"><span class="ts5">WARNING:</span><span class="ts2"> This option can only be used successfully when structures are only assigned to a single file definition. If used with a structure that is assigned to multiple file definitions the FIRST file definition will always be used.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.UseAlternateStructureNames property (Boolean).</span></p>
<p class="ps1"><a id="option_b"></a><span class="ts4"> -ba|d|n</span></p>
<p class="ps10"><span class="ts2">Override default button loop processing rules.</span></p>
<p class="ps10"><span class="ts3">-ba </span><span class="ts2">Always use the default buttons defined in DefaultButtons.xml.</span><br /><span class="ts3">-bd </span><span class="ts2">Never use the default buttons defined in DefaultButtons.xml.</span><br /><span class="ts3">-bn </span><span class="ts2">Never load any buttons (DefaultButtons.xml or window script).</span></p>
<p class="ps10"><span class="ts2">In-process API equivalents:</span></p>
<p class="ps10"><span class="ts3">-ba </span><span class="ts2">CodeGenTask.AlwaysLoadDefaultButtons property (Boolean)</span><br /><span class="ts3">-bd </span><span class="ts2">CodeGenTask.NeverLoadDefaultButtons property (Boolean)</span><br /><span class="ts3">-bn </span><span class="ts2">CodeGenTask.NeverLoadAnyButtons property (Boolean)</span></p>
<p class="ps1"><a id="option_c"></a><span class="ts4"> -c</span></p>
<p class="ps10"><span class="ts2">Continue processing after errors. If multiple templates, files or tasks are being processed then this option allows code generation to continue even though one template/structure combination has generated an error.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.ContinueAfterError property (Boolean)</span></p>
<p class="ps1"><a id="option_cdm"></a><span class="ts4"> -cdm <filespec></span></p>
<p class="ps10"><span class="ts2">Specifies that custom data mappings are loaded from an XML file. Refer to Customizing Data Type Mappings in the docs for more info.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.DataMappingsFile property (String)</span></p>
<p class="ps1"><a id="option_ch"></a><span class="ts4"> -ch <pixels></span></p>
<p class="ps10"><span class="ts2">Overrides the default number of pixels per row to be used when calculating pixel coordinates using tokens like </span><a href="fieldloopexpansiontokens.htm#FIELD_PIXEL_ROW" class="hs2"><FIELD_PIXEL_ROW></a><span class="ts2">.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.CharacterHeight property (int)</span></p>
<p class="ps1"><a id="option_checkversion"></a><span class="ts4"> -checkversion [interval]</span></p>
<p class="ps10"><span class="ts2">Checks whether there is a later version of CodeGen available for download. This option requires Internet connectivity. If you do not specify an interval value then CodeGen will perform an immediate check for available updates and will report the result. If you specify an interval of 1 or more (days) then CodeGen will automatically check for available updates after that many days has expired since the previous update check; the update check will take place the next time you use CodeGen and you will see messages as the update check takes place. To cancel a previously scheduled automatic update checks specify an interval of 0.</span></p>
<p class="ps1"><a id="option_cw"></a><span class="ts4"> -cw <pixels></span></p>
<p class="ps10"><span class="ts2">Overrides the default number of pixels per character to be used when calculating pixel coordinates using tokens like </span><a href="fieldloopexpansiontokens.htm#FIELD_PIXEL_WIDTH" class="hs2"><FIELD_PIXEL_WIDTH></a><span class="ts2">.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.CharacterWidth property (int)</span></p>
<p class="ps1"><a id="option_d"></a><span class="ts4"> -d</span></p>
<p class="ps10"><span class="ts2">Debug mode. Displays additional information during processing; more than verbose mode.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.LoggingLevel property (use LoggingLevel.Debug)</span></p>
<p class="ps1"><a id="option_database"></a><span class="ts4"> -database SQLServer | MySQL | PostgreSQL</span></p>
<p class="ps10"><span class="ts2">Database type. Specifies the relational database that code is being generated for by altering the SQL data types emitted by the </span><a href="fieldloopexpansiontokens.htm#FIELD_SQLTYPE" class="hs2"><FIELD_SQLTYPE></a><span class="ts2"> token. The default database type is SQLServer, unless altered by the </span><a href="installingandconfiguringcodegen.htm#CODEGEN_DATABASE_TYPE" class="hs2">CODEGEN_DATABASE_TYPE</a><span class="ts2"> environment variable.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.DatabaseType property</span></p>
<p class="ps1"><a id="option_define"></a> <span class="ts4">-define <identifier> [<identifier>...]</span></p>
<p class="ps10"><span class="ts2">Defines one or more identifiers, the presence of which can be tested in template files to implement </span><a href="conditionalprocessing.htm" class="hs4">conditional processing</a><span class="ts2">.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.Defines property (List<string>)</span></p>
<p class="ps1"><a id="option_docs"></a><span class="ts4"> -docs</span></p>
<p class="ps10"><span class="ts2">Displays the CodeGen documentation, either the Windows help file if the documentation is installed locally, or the on-line documentation if not. Bear in mind that the on-line documentation will always be for the latest version of CodeGen, which may be later than the version that you are currently running.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: None</span></p>
<p class="ps1"><a id="option_dt"></a><span class="ts4"> -dt</span></p>
<p class="ps10"><span class="ts2">Debug tree. Creates log files containing the internal results of the code tokenization and parsing phases.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.LogTokenizerResults property (Boolean)</span></p>
<p class="ps1"><a id="option_e"></a><span class="ts4"> -e</span></p>
<p class="ps10"><span class="ts2">Echo the command line used to start CodeGen. This can be useful when starting CodeGen from a batch file in which echo has been disabled but where you want to see a representation of the commands that are being executed.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.EchoCommands property (Boolean)</span></p>
<p class="ps1"><a id="option_elf"></a><span class="ts4"> -elf</span></p>
<p class="ps10"><span class="ts2">Restores the original CodeGen behavior failing if certain types of loop are encountered with no supporting data. For example, if a key loop is encountered when processing a structure with no keys.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.EmptyLoopFail property (Boolean)</span></p>
<p class="ps1"><a id="option_f"></a><span class="ts4"> -f [o|l|t|r|w]</span></p>
<p class="ps10"><span class="ts2">Override default field loop processing rules.</span></p>
<p class="ps1"><span class="ts3"> -f o </span><span class="ts2">Include overlay fields.</span><br /><span class="ts3"> -f l </span><span class="ts2">DO NOT exclude fields which are "Excluded by Language".</span><br /><span class="ts3"> -f t </span><span class="ts2">Exclude fields which are "Excluded by Toolkit".</span><br /><span class="ts3"> -f r </span><span class="ts2">Exclude fields which are "Excluded by ReportWriter".</span><br /><span class="ts3"> -f w </span><span class="ts2">Exclude fields which are "Excluded by Web".</span></p>
<p class="ps10"><span class="ts2">In-process API equivalents:</span></p>
<p class="ps1"><span class="ts3"> -f o </span><span class="ts2">CodeGenTask.IncludeOverlayFields property (Boolean)</span><br /><span class="ts3"> -f l </span><span class="ts2">CodeGenTask.IgnoreExcludeLanguage property (Boolean)</span><br /><span class="ts3"> -f t </span><span class="ts2">CodeGenTask.HonorExcludeToolkit property (Boolean)</span><br /><span class="ts3"> -f r </span><span class="ts2">CodeGenTask.HonorExcludeReportWriter property (Boolean)</span><br /><span class="ts3"> -f w </span><span class="ts2">CodeGenTask.HonorExcludeWeb property (Boolean)</span></p>
<p class="ps1"><a id="fields"></a><span class="ts4"> -fields [str.]field [[str.]field] ...</span></p>
<p class="ps10"><span class="ts2">Creates a field subset based on the list of fields listed on the command line. When processing multiple structures concurrently (via the -ms or -file options) field names may be prefixed with the appropriate structure names.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.SubsetFields property (List<Tuple<String, String>>)</span></p>
<p class="ps1"><a id="option_file"></a><span class="ts4"> -file filename</span></p>
<p class="ps10"><span class="ts2">Repository file name to process. This option causes all structures that are assigned to the file definition to be available for use when processing templates. The end result is similar to specifying multiple structures with -s and using the -ms option.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.RepositoryFile property (String).</span></p>
<p class="ps1"><a id="option_fo"></a><span class="ts4"> -fo file [...]</span></p>
<p class="ps10"><span class="ts2">File Overrides. Allows you to specify which repository file definition is used for each structure being processing. This option is useful if the structure that you are using is assigned to multiple files because by default CodeGen will use the first assigned file. When the -fo option is used you must specify at least one repository file definition name, and have the option of specifying file overrides for multiple structures, up to but not exceeding the number of structures specified via the -s option. If you wish to omit a file override for a structure in the middle of the list then specify an empty string by passing two double quote characters.</span></p>
<p class="ps10"><span class="ts2">If you are using a </span><a href="structureinputfiles.htm" class="hs2">structure list input file</a><span class="ts2"> then file overrides must be specified via that file.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.FileOverrides property (List<String>).</span></p>
<p class="ps1"><a id="option_g"></a><span class="ts4"> -g f|r|i</span></p>
<p class="ps10"><span class="ts2">Override default group field name prefix rules</span></p>
<p class="ps1"><span class="ts3"> -g e </span><span class="ts2">Don't expand explicit groups to individual fields. Explicit groups are group fields with locally defined members.</span><br /><span class="ts3"> -g f </span><span class="ts2">Don't prefix group fields with group name.</span><br /><span class="ts3"> -g i </span><span class="ts2">Don't expand implicit groups to individual fields. Implicit groups are group fields where the members are defined by another structure.</span><br /><span class="ts3"> -g r </span><span class="ts2">Don't use repository group field prefix.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalents:</span></p>
<p class="ps1"><span class="ts3"> -g e </span><span class="ts2">CodeGenTask.ExplicitGroupNoExpand property (Boolean)</span><br /><span class="ts3"> -g f </span><span class="ts2">CodeGenTask.GroupFieldNoGroupPrefix property (Boolean)</span><br /><span class="ts3"> -g i </span><span class="ts2">CodeGenTask.ImplicitGroupNoExpand property (Boolean)</span><br /><span class="ts3"> -g r </span><span class="ts2">CodeGenTask.GroupFieldNoRpsPrefix property (Boolean)</span></p>
<p class="ps1"><a id="option_goat"></a><span class="ts3"> -goat</span></p>
<p class="ps10"><span class="ts2">Enables very special and top secret processing rules for the exclusive use of GI Computer Solutions, Ltd.</span></p>
<p class="ps10"><span class="ts5">WARNING:</span><span class="ts2"> Use with care, results may be disturbing to others!</span></p>
<p class="ps1"><a id="option_h"></a><span class="ts4"> -h | -?</span></p>
<p class="ps10"><span class="ts2">Display command-line help information.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: None</span></p>
<p class="ps1"><a id="option_i"></a><span class="ts4"> -i inpdir</span></p>
<p class="ps10"><span class="ts2">Input file directory containing templates. Defaults to the current directory, or the directory specified with the </span><a href="installingandconfiguringcodegen.htm#tpldir" class="hs2">CODEGEN_TPLDIR</a><span class="ts2"> environment variable. You can specify a full or relative path, or a logical name followed by a colon (e.g. TPL:).</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.TemplateFolder property (String) or CodeGenTask.TemplateFolder property (String)</span></p>
<p class="ps1"><a id="option_input"></a><span class="ts4"> -input file</span></p>
<p class="ps10"><span class="ts2">Load code generation instructions from a previously saved code generation instructions file. Refer to </span><a href="commandlinereference.htm#option_save" class="hs2">-save</a><span class="ts2"> for information about saving an instructions file.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.LoadFromFile(file,taskset) method.</span></p>
<p class="ps1"><a id="option_lf"></a><span class="ts4"> -lf</span></p>
<p class="ps10"><span class="ts2">List Files. Lists the names of any files generated when not running in verbose or debug logging modes.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.ListGeneratedFiles property (Boolean)</span></p>
<p class="ps1"><a id="option_ms"></a><span class="ts4"> -ms</span></p>
<p class="ps10"><span class="ts2">Multiple Structures. Specifies that the structures that follow the -s command line option should all be available to templates being processed, at the same time.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MultipleStructures property (Boolean).</span></p>
<p class="ps1"><a id="option_mw"></a><span class="ts4"> -mw</span></p>
<p class="ps10"><span class="ts2">Multi-write a file if the same file is generated more than once.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MultiWriteFiles property (Boolean)</span></p>
<p class="ps1"><a id="option_n"></a><span class="ts4"> -n namespace</span></p>
<p class="ps10"><span class="ts2">The namespace to use when replacing the </span><a href="genericexpansiontokens.htm#%3CNAMESPACE%3E" class="hs2"><NAMESPACE></a><span class="ts2"> token. Codegen will determine the default namespace using the environment variable SYNDEFNS, and this can be overridden with the -n option.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.Namespace property (String)</span></p>
<p><a id="option_ncp"></a><span class="ts3"> </span><span class="ts4">-ncp</span></p>
<p> </p>
<p class="ps11">No custom pluralization. Using this option suppresses the features<span class="ts2"> </span>of the <STRUCTURE_PLURAL> and <STRUCTURE_NOPLURAL> tokens, making<span class="ts2"> </span>them behave the same as <STRUCTURE_NAME><span class="ts2">.</span></p>
<p class="ps11"><span class="ts2"> </span></p>
<p class="ps11"><span class="ts2">In-process API equivalent: CodeGenTask.NoCustomPluralization property (Boolean)</span></p>
<p> </p>
<p class="ps1"><a id="option_nf"></a><span class="ts4"> -nf</span></p>
<p class="ps10"><span class="ts2">Don't append sub-folder to namespace. If a template file uses the </span><a href="fileheadertokens.htm#%3CCODEGEN_FOLDER%3E" class="hs2"><CODEGEN_FOLDER></a><span class="ts2"> token to specify that files created from the template should be created in a sub-folder below the main output folder, then by default, if a namespace is also being used, the name of the sub-folder is appended to the namespace. This option overrides that behavior.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.DontAppendFolderToNamespace property (Boolean)</span></p>
<p class="ps1"><a id="option_o"></a><span class="ts4"> -o outdir</span></p>
<p class="ps10"><span class="ts2">Output directory. Defaults to the current directory, or the directory specified with the </span><a href="installingandconfiguringcodegen.htm#outdir" class="hs2">CODEGEN_OUTDIR</a><span class="ts2"> environment variable. You can use a full or relative path, or a logical followed by a colon (e.g. SRC:).</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.OutputFolder property (String) or CodeGenTask.OutputFolder property (String)</span></p>
<p class="ps1"><a id="option_opk"></a><span class="ts4"> -opk <keyNumber></span></p>
<p class="ps10"><span class="ts2">Overrides the key that is used when a primary key block (<PRIMARY_KEY>) is used. By default the first key defined by the structure is used.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.PrimaryKeyNumber property (int)</span></p>
<p class="ps1"><a id="option_pa"></a><span class="ts4"> -pa</span></p>
<p class="ps10"><span class="ts2">Preserve arrays; do not expand arrays into individual fields. </span></p>
<p class="ps10"><span class="ts5">WARNING:</span><span class="ts2"> This is an experimental feature and may currently cause unexpected side effects with some expression tokens.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.PreserveArrays property (Boolean)</span></p>
<p class="ps1"><a id="option_prefix"></a><span class="ts4"> -prefix <name></span></p>
<p class="ps10"><span class="ts2">When using the </span><a href="fieldloopexpansiontokens.htm#FIELD_NAME" class="hs2"><FIELD_NAME></a><span class="ts2"> token, prefix field names with <name>. Useful with repository .include with the optional prefix= qualifier.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.FieldPrefix property (String)</span></p>
<p class="ps1"><a id="option_rps"></a><span class="ts4"> -rps <mainfile> <textfile></span></p>
<p class="ps10"><span class="ts2">Allows the repository main and text files to be used to be specified on the command line, overriding other mechanisms for repository selection such as RPSDAT, RPSMFIL and RPSTFIL environment variables.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.RepositoryMainFile and CodeGenTask.RepositoryTextFile properties (String)</span></p>
<p class="ps1"><a id="option_rpsoverride"></a><span class="ts4"> -rpsoverride <override_file></span></p>
<p class="ps10"><span class="ts2">Specifies the name of a </span><a href="repositoryoverridefiles.htm" class="hs4">repository override file</a><span class="ts2">.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.RepositoryOverrideFile property (String)</span></p>
<p class="ps1"><a id="option_save"></a><span class="ts4"> -save [file]</span></p>
<p class="ps10"><span class="ts2">Save the code generation instructions used during the current invocation to a code generation instructions file. The file can then be used later with the </span><a href="commandlinereference.htm#option_input" class="hs2">-input</a><span class="ts2"> option. If the code generation invocation was launched via </span><a href="commandlinereference.htm#option_input" class="hs2">-input</a><span class="ts2"> then you should not specify a file name after -save because the file name specified with </span><a href="commandlinereference.htm#option_input" class="hs2">-input</a><span class="ts2"> will be used. If you are not processing an existing instructions file then you must specify the file to create. The file name may be an absolute or relative path, or may have the location specified via a logical name.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.SaveToFile(file) method.</span></p>
<p class="ps1"><a id="option_sp"></a><span class="ts4"> -sp <prefix></span></p>
<p class="ps10"><span class="ts2">Specifies a prefix that should be added to the structure name for struct field data type definitions.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.StructFieldPrefix property (String).</span></p>
<p class="ps1"><a id="option_subset"></a><span class="ts4"> -subset name</span></p>
<p class="ps10"><span class="ts2">Subset of fields to use. Specify subsets in field user text strings with @SUB=name; syntax. This option is only valid when processing a single repository structure.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.Subset property (String).</span></p>
<p class="ps1"><a id="option_tf"></a><span class="ts4"> -tf</span></p>
<p class="ps10"><span class="ts2">Allow template defined folders. From CodeGen V5.0.2 it has been possible for template files to define the name of a sub folder (below the main output folder) where files generated from the template should be created. This is done by using the file header token </span><a href="fileheadertokens.htm#%3CCODEGEN_FOLDER%3E" class="hs2"><CODEGEN_FOLDER></a><span class="ts2">. This option enables this functionality.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.AllowTemplateFolder property (Boolean)</span></p>
<p class="ps1"><a id="option_u"></a><span class="ts3"> </span><span class="ts4">-tweaks TWEAK1[ TWEAKn]</span></p>
<p class="ps10"><span class="ts2">Activate a specific named tweak to the way the CodeGen works. Tweaks implement minor variations in processing.</span></p>
<p class="ps1"><a id="option_u"></a><span class="ts4"> -u usertokenfile</span></p>
<p class="ps10"><span class="ts2">User defined token file. Specify a full or relative file spec of the file that contains user defined token definitions. The file spec can include Synergy logical names.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.UserTokenFile property (String)</span></p>
<p class="ps1"><a id="option_ut"></a><span class="ts4"> -ut name=value [...]</span></p>
<p class="ps10"><span class="ts2">User defined tokens specified via the command line. You must specify at least one name=value, and may optionally specify multiple name=value pairs separated by spaces. If spaces exist in the name or value then you should enclose the entire name=value pair in quotation marks.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.UserTokens property (List<UserToken>)</span></p>
<p class="ps1"><a id="option_utpp"></a><span class="ts4"> -utpp</span></p>
<p class="ps10"><span class="ts2">Treat user-defined tokens as preprocessor tokens, expanding them out to their constituent parts during the initial tokenization phase. This enables other tokens to be embedded in the values of user-defined tokens.</span></p>
<p class="ps1"><a id="option_v"></a><span class="ts4"> -v</span></p>
<p class="ps10"><span class="ts2">Verbose mode. Displays additional information during processing; not as much as debug (-d) mode.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.LoggingLevel property (use LoggingLevel.Verbose)</span></p>
<p class="ps1"><a id="option_version"></a><span class="ts4"> -version</span></p>
<p class="ps10"><span class="ts2">Display the version of CodeGen that you are running.</span></p>
<p class="ps1"><a id="option_w"></a><span class="ts4"> -w <wscfile>[#n]</span></p>
<p class="ps10"><span class="ts2">Process input from a UI Toolkit Window script file. By default the fields and buttons collection will be based on the first input window found in the script file, but this can be overridden using the #n qualifier, which specifies either a 1-based input window number or the name of the input window to process.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.WindowScript property (String)</span></p>
<p class="ps1"><a id="option_wn"></a><span class="ts4"> -wn</span></p>
<p class="ps10"><span class="ts2">When processing input from a UI Toolkit Window script file this option prevents script file input window field attributes from being used to override repository field attributes. This allows you to generate code based on only the fields listed in an input window, but using only the repository field definitions.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.IgnoreScriptFieldAttributes property (Boolean)</span></p>
<p class="ps1"><a id="option_ws"></a><span class="ts4"> -ws <wscfile></span></p>
<p class="ps10"><span class="ts2">Window script selection list processing. When this option is used CodeGen will examine any fields which have selection windows specified and will attempt to populate the field selections property based on the selection items defined in the named selection window.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.SelectionWindowScript property (String) </span></p>
<h2 class="hd1"><span class="ts1">Processing a Synergy Method Catalog</span></h2>
<p class="ps1"><span class="ts2">These options are used to perform code generation based on metadata contained in a Synergy Method Catalog XML export file.</span></p>
<p class="ps1"><a id="option_smc"></a><span class="ts4"> -smc <smcXmlFile></span></p>
<p class="ps10"><span class="ts2">Synergy method catalog XML file to use. When using this option you may not use the -s option to specify specific structures to process. If you also specify the </span><a href="commandlinereference.htm#option_interface" class="hs2">-interface</a><span class="ts2"> option then only that interface will be processed, and you may not use interface loops in your template files. If you do not specify the -interface option then you MUST use an interface loop in your template file.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MethodCatalogFile (string)</span></p>
<p class="ps1"><a id="option_smcext"></a><span class="ts4"> -smcext <smcExtensionsFile></span></p>
<p class="ps10"><span class="ts2">Synergy </span><a href="idh-topic40.htm" class="hs0">method catalog extensions file</a><span class="ts2"> to use. </span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MethodCatalogExtensionsFile (string)</span></p>
<p class="ps1"><a id="option_smcstrs"></a><span class="ts3"> </span><span class="ts4">-smcstrs <smcXmlFile></span></p>
<p class="ps10"><span class="ts2">This option causes the list of structures to be processed to be limited to the structured referenced in a Synergy Method Catalog XML export file. By default all structures listed in the XML file will be processed regardless of which interface(s) they are referenced by. The only information drawn from the XML file is the list of structure names; all structure attributes are taken from the repository. This option is used with regular REPOSITORY-BASED code generation and DOES NOT enable the processing of </span><a href="interfaceloops.htm" class="hs4">interface loops</a><span class="ts2">, </span><a href="methodloops.htm" class="hs4">method loops</a><span class="ts2"> or </span><a href="parameterloops.htm" class="hs4">parameter loops</a><span class="ts2">. This option may not be used in conjunction with the </span><a href="commandlinereference.htm#option_s" class="hs2">-s</a><span class="ts2"> or </span><a href="commandlinereference.htm#option_smc" class="hs2">-smc</a><span class="ts2"> options.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MethodCatalogFile (string) and set CodeGenTask.MethodCatalogStructureMode (boolean) to true.</span></p>
<p class="ps1"><a id="option_interface"></a><span class="ts4"> -interface <interfaceName></span></p>
<p class="ps10"><span class="ts2">The name of the interface in the Synergy Method Catalog XML file that you wish to generate code for. This option is only valid in conjunction with the </span><a href="commandlinereference.htm#option_smc" class="hs2">-smc</a><span class="ts2"> and </span><a href="commandlinereference.htm#option_smcstrs" class="hs0">-smcstrs</a><span class="ts2"> options, and cannot be used with the </span><a href="commandlinereference.htm#option_iloop" class="hs0">-iloop</a><span class="ts2"> option.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MethodCatalogInterface (string).</span></p>
<p class="ps1"><a id="option_iloop"></a><span class="ts3"> </span><span class="ts4">-iloop <interfaceName> [<interfaceName> ...]</span></p>
<p class="ps10"><span class="ts2">The name of one or more interfaces in the Synergy Method Catalog XML file that you wish to be processed by any interface loops. This option is only valid in conjunction with the </span><a href="commandlinereference.htm#option_smc" class="hs2">-smc</a><span class="ts2"> option, and cannot be used with the </span><a href="commandlinereference.htm#option_interface" class="hs0">-interface</a><span class="ts2"> option.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MethodCatalogInterfaces (@ObservableCollection<string>).</span></p>
<p class="ps1"><a id="option_mexclude"></a><span class="ts3"> </span><span class="ts4">-mexclude <methodName> [<methodName> ...]</span></p>
<p class="ps10"><span class="ts2">The name of one or more methods in the Synergy Method Catalog that you wish to exclude from processing. This option can only be used with the </span><a href="commandlinereference.htm#option_smc" class="hs2">-smc</a><span class="ts2"> and </span><a href="commandlinereference.htm#option_interface" class="hs2">-interface</a><span class="ts2"> options.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MethodCatalogExcludeMethods (@ObservableCollection<string>)</span></p>
<p class="ps1"><a id="option_minclude"></a><span class="ts3"> </span><span class="ts4">-minclude <methodName> [<methodName> ...]</span></p>
<p class="ps10"><span class="ts2">The name of one or more methods in the Synergy Method Catalog that you wish to include in processing; all other methods will be excluded. This option can only be used with the </span><a href="commandlinereference.htm#option_smc" class="hs2">-smc</a><span class="ts2"> or </span><a href="commandlinereference.htm#option_smcstrs" class="hs0">-smcstrs</a><span class="ts2"> options, and the </span><a href="commandlinereference.htm#option_interface" class="hs2">-interface</a><span class="ts2"> option.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MethodCatalogIncludeMethods (@ObservableCollection<string>)</span></p>
<p class="ps1"><a id="option_pexclude"></a><span class="ts3"> </span><span class="ts4">-pexclude <jsonFile></span></p>
<p class="ps10"><span class="ts2">Identifies then name of a JSON file containing an array of strings that are the names of parameters that you wish to exclude when processing parameter loops. This option can only be used with the with the -smc option. Parameter names are NOT case sensitive when processed by this feature. An example of a JSON file that can be used with this feature is:</span></p>
<p class="ps10"><span class="ts3">[ "param1", "spare", "roomToGrow" ]</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MethodCatalogExcludeParameters (@ObservableCollection<string>)</span></p>
<p class="ps1"><a id="option_pinclude"></a><span class="ts3"> </span><span class="ts4">-pinclude <jsonFile></span></p>
<p class="ps10"><span class="ts2">Identifies then name of a JSON file containing an array of strings that are the names of parameters that you wish to include when processing parameter loops. All other parameters will be excluded. This option can only be used with the with the -smc option. Parameter names are NOT case sensitive when processed by this feature. An example of a JSON file that can be used with this feature is:</span></p>
<p class="ps10"><span class="ts3">[ "param1", "spare", "roomToGrow" ]</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTask.MethodCatalogIncludeParameters (@ObservableCollection<string>)</span><br /><span class="ts2"> </span></p>
<h2 class="hd1"><span class="ts1">Advanced Debugging Options</span></h2>
<p class="ps1"><span class="ts2">These options are intended for use by CodeGen developers and are not particularly useful when using CodeGen to generate code.</span></p>
<p class="ps1"><a id="option_attach"></a><span class="ts4"> -attach</span></p>
<p class="ps10"><span class="ts2">Intended for use by CodeGen developers, this option causes CodeGen to wait for a key press at the very beginning of processing. This makes it possible to attach an external debugger to the process before processing begins.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: None</span></p>
<p class="ps1"><a id="option_debug"></a><span class="ts4"> -debug</span></p>
<p class="ps10"><span class="ts2">Developer debug mode (displays extensive debugging information).</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: CodeGenTaskSet.LoggingLevel property (use LoggingLevel.DeveloperDebug)</span></p>
<p class="ps1"><a id="option_pause"></a><span class="ts4"> -pause</span></p>
<p class="ps10"><span class="ts2">Causes CodeGen to wait for a key press at the very end of processing. This makes it possible to perform final tasks before a debugging environment terminates.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: None</span></p>
<p class="ps1"><a id="option_rethrow"></a><span class="ts4"> -rethrow</span></p>
<p class="ps10"><span class="ts2">Causes CodeGen to re-throw some caught exceptions to assist with debugging scenarios.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: None</span></p>
<p class="ps1"><a id="option_time"></a> <span class="ts4">-time</span></p>
<p class="ps10"><span class="ts2">Displays the elapsed time taken to process the command.</span></p>
<p class="ps10"><span class="ts2">In-process API equivalent: None</span></p>
<p><span class="ts2"> </span></p>
<p><span class="ts2"> </span></p>
<div>
<hr class="hline1" />
</div>
<p class="ps8"><span class="ts10">Copyright © 2021 Synergex International, Inc.</span></p>
</div>
</div>
</div>
</body>
</html>