Command Line Interface - TypeCobolTeam/TypeCobol GitHub Wiki

Command Line Interface (TypeCobol.CLI)

List of parameters

name(min) name (full) needed arguments default value description
i input Y {PATH}(1) {PATH} to an input file to parse. This option can be specified more than once
o output N {PATH}(1)(2) {PATH} to an ouput file where to generate code. This option can be specified more than once
d diagnostics N {PATH}(2) {PATH} to the error diagnostics file
s skeletons N(Y if ets=5) {PATH} {PATH} to the skeletons file
a autoremarks N ---- Enable automatic remarks creation while parsing and generating Cobol
hc haltonmissingcopy N {PATH}(2) HaltOnMissing Copy will generate a file to list all the absent copies
ets exectostep N [0-5]/string Generate(5) ExecToStep will execute TypeCobol Compiler until the included given step (Scanner/0, Preprocessor/1, SyntaxCheck/2, SemanticCheck/3, CrossCheck/4, Generate/5)
e encoding N "rdz"/"zos"/"utf8" rdz {ENCODING} of the file(s) to parse. It can be one of "rdz" (this is the default), "zos" or "utf8". If this option is not present, the parser will attempt to guess the {ENCODING} automatically
ie inputencoding N string rdz Allows to change default encoding when used with RDZ format. Specify a valid encoding name, example : -ie "Windows-1252".
y intrinsic N {PATH}1 {PATH} to intrinsic definitions to load. This option can be specified more than once
c copies N {PATH}1 Folder where COBOL copies can be found. This option can be specified more than once
dp dependencies N {PATH}1 Path to folder containing programs to load and to use for parsing a generating the input program
t telemetry N ---- If set to true telemetry will send automatic email in case of bug and it will provide to TypeCobol Team data on your usage
md maximumdiagnostics N int Wait for an int value that will represent the maximum number of diagnostics that TypeCobol have to return
f outputFormat N "0"-"4"/strings Cobol85 Cobol85/0, PublicSignature/1, ExpandingCopy/2, Cobol85Mixed/3, Documentation/4)
ec expandingcopy N {PATH}(2) Generate a file with all COPY directives expanded in the source code. This option will be executed if the Preprocessor step is enabled.
exc extractusedcopy N {PATH}(2) Generate a file with all COPIES detected by the parser
k startServer N "hidden" NormalWindow Start the server if not already started, and executes commandline. By default the server is started in window mode, '{hidden}' hide the window.
1 once N ---- Parse one set of files and exit. If present, this option does NOT launch the server.
h help N ---- Output a usage message and exit.
V version N ---- Output the version number of " + PROGNAME + " and exit.
p pipename N string TypeCobol.Server Pipename used if running as server. Default: "TypeCobol.Server".
alr antlrprogparse N ---- Use ANTLR to parse a program.
cmr copymovereport N {PATH} {PATH} to Report all Move and Initialize statements that target a COPY.
zcr zcallreport N {PATH} {PATH} to report of all program called by zcallpgm.
dcs disablecopysuffixing N ---- Deactivate Euro-Information suffixing.
glm genlinemap N {PATH} {PATH} to an output file where line mapping will be generated.
diag.cea diagnostic.checkEndAlignment N string Indicate level of check end aligment: warning, error, info, ignore.
log logfilepath N {PATH} {PATH} to TypeCobol.CLI.log log file
cfg cfgbuid N ---- Standard CFG build.
ca customanalyzer N {PATH} {PATH} to a custom DLL file containing code analyzers. This option can be specified more than once.

(1): multiple paths can be specified. - (2): create the directory and file if they does not exist.

Examples

Parse a TypeCobol file and generate it

TypeCobol.CLI.exe -1 -i PGM1.tcbl -o PGM1.cbl -e rdz -d error.txt -s config\skeletons.xml

Parse a TypeCobol file that use a set of COPY and generate it

TypeCobol.CLI.exe -1 -i PGM1.tcbl -o PGM1.cbl -e rdz -d error.txt -s config\skeletons.xml -c .\copyFolder

Get the list of COPY missing to parse a (Type)Cobol file

TypeCobol.CLI.exe -1 -i PGM1.cbl -o PGM1.out.cbl -e rdz -d error.txt --haltonmissingcopy=MissingCopy.txt --exectostep=Preprocessor

--haltonmissingcopy=MissingCopy.txt will tell the parser to write all missing COPY into file "MissingCopy.txt" and to stop after preprocessor phase.

--exectostep=Preprocessor if no copy are missing, this parameter make sure the parser only execute to phase Preprocessor.

Table of Errors


Error code Name Message
0 Success
1 Warning
1000 ParsingDiagnostics Syntax or semantic error in one or more input file.
1001 OutputFileError The number of output files must be equal to the number of input files.
1002 MissingCopy Use of option --haltonmissingcopy and at least one COPY is missing.
1003 GenerationError Error during Code generatio.
1004 FatalError Not managed error.
1005 UnexpectedParamError Unexpected parameter given.
1010 InputFileMissing Input file(s) are required.
1011 OutputFileMissing Output are required in execution to generate step.
1020 InputFileError Input files given are unreachable.
1021 OutputFileErrorBis Output paths given are unreachable.
1022 ErrorFileError Error diagnostics path is unreachable.
1024 HaltOnMissingCopyError Missing copy path given is unreachable.
1025 ExecToStepError Unexpected parameter given for ExecToStep. Accepted parameters are "Scanner"/0, "Preprocessor"/1, "SyntaxCheck"/2, "SemanticCheck"/3, "CrossCheck"/4, "Generate"/5(default).
1026 EncodingError Unexpected parameter given for encoding option. Accepted parameters are "rdz"(default), "zos", "utf8".
1027 IntrinsicError Intrinsic files given are unreachable.
1028 CopiesError Copies files given are unreachable.
1029 DependenciesError Dependencies files given are unreachable.
1030 MaxDiagnosticsError Maximum diagnostics have to be an integer.
1031 OutputFormatError Unexpected user input for outputFormat option
1032 ExpandingCopyError Expanding copy path given is unreachable.
1033 ExtractusedCopyError Extractused copy path given is unreachable.
1034 LogFileError Wrong log path given.
1035 CustomAnalyzerFileError Invalid path to custom analyzer DLL file.
9999 MultipleErrors