File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -786,6 +786,9 @@ static void cobc_print_usage(void) {
786
786
_ (" -assign_external Set the file assign to external" ));
787
787
puts (_ (" -java-package(=<package name>) Specify the package name of the "
788
788
"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." ));
789
792
putchar ('\n' );
790
793
791
794
#undef CB_WARNDEF
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
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
3
8
while getopts c:t-: opt; do
4
9
optarg=" $OPTARG "
5
10
if [[ " $opt " = - ]]; then
@@ -27,11 +32,14 @@ while getopts c:t-: opt; do
27
32
done
28
33
shift $(( OPTIND - 1 ))
29
34
35
+
30
36
case " $target " in
37
+ # when `--target=main-class` is specified
31
38
main-class-annotation)
32
39
echo " @Component"
33
40
exit 0
34
41
;;
42
+ # when `--target=file-header` is specified
35
43
file-header)
36
44
echo ' import org.slf4j.Logger;'
37
45
echo ' import org.slf4j.LoggerFactory;'
@@ -42,10 +50,12 @@ case "$target" in
42
50
echo ' import org.springframework.stereotype.Component;'
43
51
exit 0
44
52
;;
53
+ # when `--target=main-class` is specified
45
54
main-class-implements)
46
55
echo -n ' Tasklet'
47
56
exit 0
48
57
;;
58
+ # when `--target=main-class` is specified
49
59
main-class-contents)
50
60
echo ' @Override'
51
61
echo ' public RepeatStatus execute(StepContribution conribution, ChunkContext chunkContext) throws Exception {'
Original file line number Diff line number Diff line change 54
54
$skip {SG203A } = 1;
55
55
$skip {OBNC1M } = 1;
56
56
$skip {OBNC2M } = 1;
57
- $skip {IX106A } = 1;
57
+ # $skip{IX106A} = 1;
58
58
$skip {NC127A } = 1;
59
59
$skip {IC222A } = 1;
60
60
$skip {IC223A } = 1;
You can’t perform that action at this time.
0 commit comments