Rename: change the SyntaxShape of -c flag from list to record (#10526)

# Description
Fixes: #7085 
Also closes: #7526 

# User-Facing Changes
After this change, we need to use `-c` flag like this:
```nushell
[[a, b, c]; [1, 2, 3]] | rename -c { a: ham }
```
But we can rename many columns easily, here is another example:
```nushell
[[a, b, c]; [1, 2, 3]] | rename -c { a: ham, b: ham2 }
```
This commit is contained in:
WindSoilder
2023-09-30 21:59:47 +08:00
committed by GitHub
parent 85d6529f0d
commit d34581db4a
2 changed files with 44 additions and 38 deletions

View File

@ -107,10 +107,10 @@ fn errors_if_columns_param_is_empty() {
| lines
| wrap name
| default "arepa!" hit
| rename -c []
| rename -c {}
"#
));
assert!(actual.err.contains("The column list cannot be empty"));
assert!(actual.err.contains("The column info cannot be empty"));
})
}