feat: add --debug flag to cksum
Implements the --debug flag for the cksum utility. This flag indicates
which implementation is being used for the checksum calculation.
Changes:
- Add DEBUG constant to options module
- Add --debug argument to CLI with help text
- Add help text translations (en-US and fr-FR)
- Add comprehensive tests for --debug flag with various scenarios
The flag is currently a no-op but provides the foundation for future
implementation of debug output functionality.
cksum: implement --debug flag functionality
Fully implement the --debug flag for cksum utility to display which
hash algorithm is being used for each file processed.
Changes:
- Add debug field to Options struct
- Create print_debug_info() function to output algorithm information
- Integrate debug output into checksum processing flow
- Update localization strings (en-US and fr-FR) for debug messages
- Remove '(not yet implemented)' disclaimer from help text
- Add comprehensive test coverage for debug flag with various algorithms
The implementation outputs debug information to stderr (matching GNU
cksum behavior) in the format: 'filename: ALGORITHM' or 'standard input:
ALGORITHM' for stdin.
Tests verify debug output works correctly with:
- Default CRC algorithm
- MD5, SHA1, SHA256, BLAKE2b algorithms
- Single files, multiple files, and stdin input
- Custom BLAKE2b lengths
All 135 cksum tests pass with no clippy warnings.
6328c51
2 days ago
by naoNao89
+0.02%
Merge branch 'main' into fix-cksum-debug-flag
0e1707c
13 hours ago
by naoNao89
+0.04%
chore: update Cargo.lock after merge
09efa85
12 hours ago
by naoNao89
-4.36%
chore: update fuzz/Cargo.lock for MSRV 1.85.0 compatibility
c4276f6
6 hours ago
by naoNao89
+1.29%
chore: add CPU feature terms to cspell dictionary
Added technical terms for CPU feature detection:
- cpuid: CPU identification instruction
- cpufeatures: Rust crate for CPU feature detection
- pclmul: Carryless Multiply instruction
- pclmulqdq: Carryless Multiply Quadword instruction
- vmull: Vector Multiply Long instruction
- vpclmulqdq: Vector Carryless Multiply Quadword instruction
3d194c1
4 hours ago
by naoNao89
+3.01%
fix(cksum): make cpufeatures dependency target-specific
The cpufeatures crate only supports aarch64, loongarch64, x86, and x86-64 targets.
Make it a target-specific dependency to avoid compilation errors on unsupported
targets like arm-unknown-linux-gnueabihf.