mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 15:16:17 +02:00
Change the behavior of --ignore-case
and --multiline
options for find
(#16323)
# Description Changes the behavior of `--ignore-case` and `--multiline` options for `find`, to make them more consistent between regex mode and search term mode, and to enable more options for using find. # User-Facing Changes Search term mode is now case-sensitive by default. `--ignore-case` will make the search case-insensitive in search term mode. In regex mode, the previous behavior of adding a (?i) flag to the regex is preserved. `--multiline` will no longer add a (?m) flag in regex mode. Instead, it will make the search not split multi-line strings into lists of lines. closes #16317 closes #16022
This commit is contained in:
@ -26,10 +26,11 @@ fn find_with_list_search_with_char() {
|
||||
|
||||
#[test]
|
||||
fn find_with_bytestream_search_with_char() {
|
||||
let actual =
|
||||
nu!("\"ABC\" | save foo.txt; let res = open foo.txt | find abc; rm foo.txt; $res | get 0");
|
||||
let actual = nu!(
|
||||
"\"ABC\" | save foo.txt; let res = open foo.txt | find -i abc; rm foo.txt; $res | get 0"
|
||||
);
|
||||
let actual_no_highlight = nu!(
|
||||
"\"ABC\" | save foo.txt; let res = open foo.txt | find --no-highlight abc; rm foo.txt; $res | get 0"
|
||||
"\"ABC\" | save foo.txt; let res = open foo.txt | find -i --no-highlight abc; rm foo.txt; $res | get 0"
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
|
Reference in New Issue
Block a user