Closed magicant closed 8 months ago
The trap
built-in command has undergone a comprehensive update, enhancing its documentation, refactoring its command structure, and bolstering its error handling and testing. Parsing of command line arguments and signal numbers has been improved, and performance optimizations have been applied. The changes align terminology with POSIX standards and extend test coverage for the trap
functionality in a shell environment.
Files | Change Summary |
---|---|
yash-builtin/src/trap.rs yash-builtin/src/trap/syntax.rs |
Updated trap built-in with better documentation, refactored Command enum, improved error handling, and new tests. Added argument parser in syntax.rs . |
yash-env/src/trap.rs yash-env/src/trap/cond.rs |
Enhanced performance with inline attributes and added signal number parsing. Included a test for FromStr implementation. |
yash-env/src/trap/state.rs |
Added Hash trait to Action enum for use in hash-based collections. |
yash-syntax/src/source/pretty.rs |
Implemented new footers method in MessageBase trait and updated From implementation for Message . |
yash/tests/scripted_test.rs yash/tests/scripted_test/trap-p.sh |
Added new test function trap_builtin and a test suite for trap built-in functionality. |
Amidst the code where logic weaves, The trap ensnares with grace and ease. Bugs flee from tests, their fate is sealed, With every patch, the shell is healed. 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
trap
built-in with improved documentation and error handling.trap
.Condition
struct.Performance Improvements
#[inline]
attributes for better performance.Bug Fixes
Tests
trap
functionality and signal handling.Documentation
trap
built-in.Refactor
Command
enum andAction
enum's hash behavior.