mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 00:13:21 +01:00
ea6493c041
# Description - fixes #14174 This PR addresses a bug in the `seq char` command where the command's behavior did not align with its help description, which stated that it prints a sequence of ASCII characters. The initial implementation only allowed alphabetic characters, leading to user confusion when non-alphabetic characters (e.g., digits, punctuation) were rejected or when unexpected behavior occurred for certain input ranges. ### Changes Made: - **Updated the input validation**: Modified the `is_single_character` function to accept any ASCII character instead of restricting to alphabetic characters. - **Enhanced error messages**: Clarified error messages to specify that any single ASCII character is acceptable. - **Expanded functionality**: Ensured that the command can now generate sequences that include non-alphabetic ASCII characters. - **Updated tests**: Added tests to cover new use cases involving non-alphabetic characters and improved validation. ### Examples After Fix: - `seq char '0' '9'` now outputs `['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']` - `seq char ' ' '/'` outputs a list of characters from space to `/` - `seq char 'A' 'z'` correctly includes alphabetic and non-alphabetic characters between `A` and `z` # User-Facing Changes - Users can now input any single ASCII character for the `start` and `end` parameters of `seq char`. - The output will accurately include all characters within the specified ASCII range, including digits and punctuation. # Tests + Formatting - Added new tests to ensure the `seq char` command supports sequences including non-alphabetic ASCII characters. |
||
---|---|---|
.. | ||
commands | ||
format_conversions | ||
main.rs | ||
sort_utils.rs |