Refactor: introduce general operate commands to reduce duplicate code (#6879)

* make format filesize more flexible

* make code simpler

* finish refactor on bytes commands

* finish refactor on str commands

* fimplify code

* rename from column_paths to cell_paths
This commit is contained in:
WindSoilder
2022-10-30 05:29:46 +08:00
committed by GitHub
parent 843d8c2242
commit 457514590d
27 changed files with 902 additions and 1126 deletions

View File

@ -55,7 +55,7 @@ fn format_filesize_works() {
cwd: dirs.test(), pipeline(
r#"
ls
| format filesize size KB
| format filesize KB size
| get size
| first
"#
@ -80,7 +80,7 @@ fn format_filesize_works_with_nonempty_files() {
let actual = nu!(
cwd: dirs.test(),
"ls sample.toml | format filesize size B | get size | first"
"ls sample.toml | format filesize B size | get size | first"
);
#[cfg(not(windows))]