Skip to content

Commit 943a72e

Browse files
add: add help messages to cobj and add comments to spring_batch_tasklet.sh
1 parent d1ba92a commit 943a72e

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

cobj/cobj.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,9 @@ static void cobc_print_usage(void) {
786786
_(" -assign_external Set the file assign to external"));
787787
puts(_(" -java-package(=<package name>) Specify the package name of the "
788788
"generated source code"));
789+
puts(_(" -edit-code-command(=<command>) Specify the command to edit java "
790+
"source code. See script/spring_batch_tasklet.sh in opensource COBOL "
791+
"4J for details."));
789792
putchar('\n');
790793

791794
#undef CB_WARNDEF

script/spring_batch_tasklet.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
# This is an example of -edit-code-command.
4+
# If you run the following command, cobj generates java source code compatible for Spring Batch.
5+
# cobj -C -edit-code-command="bash spring_batch_tasklet.sh" <<<your COBOL source file>>>
6+
7+
# parse command line options with getopts
38
while getopts c:t-: opt; do
49
optarg="$OPTARG"
510
if [[ "$opt" = - ]]; then
@@ -27,11 +32,14 @@ while getopts c:t-: opt; do
2732
done
2833
shift $((OPTIND - 1))
2934

35+
3036
case "$target" in
37+
# when `--target=main-class` is specified
3138
main-class-annotation)
3239
echo "@Component"
3340
exit 0
3441
;;
42+
# when `--target=file-header` is specified
3543
file-header)
3644
echo 'import org.slf4j.Logger;'
3745
echo 'import org.slf4j.LoggerFactory;'
@@ -42,10 +50,12 @@ case "$target" in
4250
echo 'import org.springframework.stereotype.Component;'
4351
exit 0
4452
;;
53+
# when `--target=main-class` is specified
4554
main-class-implements)
4655
echo -n 'Tasklet'
4756
exit 0
4857
;;
58+
# when `--target=main-class` is specified
4959
main-class-contents)
5060
echo ' @Override'
5161
echo ' public RepeatStatus execute(StepContribution conribution, ChunkContext chunkContext) throws Exception {'

tests/cobol85/report.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
$skip{SG203A} = 1;
5555
$skip{OBNC1M} = 1;
5656
$skip{OBNC2M} = 1;
57-
$skip{IX106A} = 1;
57+
#$skip{IX106A} = 1;
5858
$skip{NC127A} = 1;
5959
$skip{IC222A} = 1;
6060
$skip{IC223A} = 1;

0 commit comments

Comments
 (0)