-
Notifications
You must be signed in to change notification settings - Fork 38
feat: Add create command of cobj-idx
#648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add create command of cobj-idx
#648
Conversation
…ser_util/indexed_file/IndexedFileUtilMain.java Co-authored-by: Copilot <[email protected]>
…ser_util/indexed_file/IndexedFileUtilMain.java Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds a new "create" command to the cobj-idx tool including tests, Java command parsing, and file creation logic.
- Implements the creation of an indexed file with key and record size validations.
- Updates tests and build scripts (Makefile.in and Makefile.am) to include the new create command functionality.
- Enhances the Java code to validate command line arguments and key formats for file creation.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cobj-idx.src/create.at | New tests covering the basic create command and error cases for missing or invalid arguments. |
| tests/cobj-idx.at, Makefile.in, Makefile.am | Updated to include the new create.at dependency. |
| IndexedFileUtilMain.java | New branch for handling the create command including parsing, validation, and file creation logic. |
| CobolFileKeyInfo.java | New helper class to encapsulate key information. |
| libcobj/Makefile.in, Makefile.am | Updated to include CobolFileKeyInfo in the build. |
Comments suppressed due to low confidence (2)
libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/user_util/indexed_file/IndexedFileUtilMain.java:261
- The regex used in parseKeyOptions is complex; consider adding inline comments to document the expected key format for improved readability and maintainability.
Pattern pattern = Pattern.compile("[1-9][0-9]*,[1-9][0-9]*(:d?[1-9][0-9]*,[1-9][0-9]*)*");
libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/user_util/indexed_file/IndexedFileUtilMain.java:747
- The boundary check using 'recordSize + 1' is not immediately clear; please add a comment explaining the rationale behind this condition to aid future maintenance.
if (keyInfo.offset <= 0 || keyInfo.size <= 0 || keyInfo.offset + keyInfo.size > recordSize + 1) {
This pull request implements create command of cobj-idx.
The following is a usage of this new command.