Introduce compressor field in Args for single compression input #52
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.
Following a suggestion by @rukai in #46, this PR aims to simplify the CLI input for compression types. Introducing a compressor field in the Args struct ensures:
Benefits:
Considerations:
To improve our CLI, this PR introduces a new CompressorType enum, specifically designed for handling CLI inputs. This new enum is analogous to the existing Compressor enum with one critical difference: it derives the clap::ValueEnum trait necessary for CLI processing.
Reasoning:
While it's tempting to simply add the clap::ValueEnum trait to our core Compressor enum, doing so muddies its purpose. The Compressor enum's primary role is to define the various compressor types our system recognizes and supports, irrespective of CLI considerations. Infusing it with a trait designed solely for CLI interaction feels architecturally unsound and blurs its clear intent.
Feedback Welcome:
Any alternative suggestions or insights into reconciling the trait requirements without compromising architectural clarity are most welcome.
Note on Merging:
Given that there's another active PR targeting the exact same file, we can hold off on merging this one for now to avoid chaos.