Merged
Conversation
Introduces the `-m` or `--multiple` option, enabling `zxc` to process several input files in a single command. Each file is handled independently, with output filenames automatically derived from the input (e.g., `file.txt` compresses to `file.txt.xc`, `file.txt.xc` decompresses to `file.txt`). When `-m` is active, output to standard output (`-c`) is explicitly disallowed to prevent ambiguous stream concatenation. Refactors the CLI's file handling to iterate over multiple input files provided on the command line. Updates argument parsing to correctly distinguish between a single input/output pair and a list of multiple input files. Adds dedicated CLI tests to cover compression, decompression, and the stdout restriction for multiple file operations.
Introduces the `--recursive` (`-r`) CLI option, enabling the processing of all regular files within specified directories and their subdirectories. The feature implicitly enables `--multiple` mode, ensuring consistency with existing multi-file processing logic. Includes OS-specific implementations for directory handling (Windows and POSIX) and comprehensive test cases.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Marks the `dirent` pointer returned by `readdir` as `const`. Ensures that directory entry data is treated as read-only within the processing loop, improving type safety and adhering to `readdir`'s expected usage.
Improves code clarity and robustness by marking variables that are not reassigned after initialization as constant.
Exposes new CLI options for batch processing in the help message. Users can now specify multiple input files with `--multiple` and process directories recursively with `--recursive`, enhancing the CLI's ability to handle a wider range of operations.
Elevates the scope of the resolved output path and introduces a flag to track if an output file was created. If an operation fails, any created output file is now automatically unlinked, preventing the accumulation of incomplete files. Adds checks for successful memory allocation before using buffers for I/O functions like `setvbuf`, improving robustness against `malloc` failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a new
--recursive(-r) command-line option, enabling the tool to process entire directory structures for compression or decompression.zxcto traverse specified directories and all their subdirectories, processing regular files encountered..xcfiles when performing recursive compression.