Closed magicant closed 9 months ago
The existing content is still valid, so I will repeat it verbatim:
The updates across various shell built-in commands (export
, readonly
, typeset
) involve enhanced documentation, refactoring, and improved functionality. The changes clarify command behaviors, standardize output, and introduce a new PrintContext
structure for consistent handling of printing variables and functions. Code refactoring includes renaming variables for clarity and removing unnecessary wrapping in closures. Tests have been added or adjusted to align with the updated built-ins.
File Path | Change Summary |
---|---|
yash-builtin/src/export.rs yash-builtin/src/readonly.rs yash-builtin/src/typeset.rs |
Updated documentation, added PrintContext , refactored code, and clarified standard output behavior. |
yash-builtin/src/lib.rs |
Simplified the execute field for the "readonly" command by removing unnecessary wrapping. |
yash-builtin/src/typeset/print_...rs |
Added PrintContext parameter to function signatures and updated tests. |
yash/tests/scripted_test.rs |
Added a new test function readonly_builtin . |
yash/tests/scripted_test/readonly-p.sh yash/tests/scripted_test/typeset-y.sh |
Modified test scripts to reflect changes in built-in commands and removed outdated TODOs. |
As autumn leaves 🍂 gently fall,
CodeRabbit 🐇 hops through the code,
Refactoring and testing with glee,
For a shell that's polished and free! 🌟
Summary by CodeRabbit
New Features
export
andreadonly
built-in commands with clarified behavior and additional documentation.typeset
built-in to print variables and functions in alphabetical order and handle array variables more effectively.Documentation
readonly
built-in covering behavior, options, operands, and standard output.Refactor
PRINT_VARIABLES_CONTEXT
toPRINT_CONTEXT
across various modules for consistency.typeset
built-in implementation to support different behaviors and introducedPrintContext
for command details.Tests
readonly
andtypeset
built-ins to ensure compliance with POSIX standards.readonly-p.sh
and updatedtypeset-y.sh
test scripts for comprehensive testing of shell built-ins.Bug Fixes
readonly
built-in to prevent re-assignment of read-only variables.