Move command changes. Refactorings. (#2683)

Continuing on anchoring and improvements on Nu's overall internal commands (#2635).
`move column` sub command has been turned into the command `move` since
we use it to move exclusively columns. Examples added as well.

Fixed it to carry along any anchor locations that might be in place if
table to be moved originates from other sources.
This commit is contained in:
Andrés N. Robalino
2020-10-20 04:07:13 -05:00
committed by GitHub
parent bc6c884a14
commit b6d19cc9fa
49 changed files with 516 additions and 625 deletions

View File

@ -22,7 +22,7 @@ fn moves_a_column_before() {
cwd: dirs.test(), pipeline(
r#"
open sample.csv
| move column column99 --before column1
| move column99 --before column1
| rename chars
| get chars
| str trim
@ -57,7 +57,7 @@ fn moves_columns_before() {
cwd: dirs.test(), pipeline(
r#"
open sample.csv
| move column column99 column3 --before column2
| move column99 column3 --before column2
| rename _ chars_1 chars_2
| get chars_2 chars_1
| str trim
@ -92,8 +92,8 @@ fn moves_a_column_after() {
cwd: dirs.test(), pipeline(
r#"
open sample.csv
| move column letters --after and_more
| move column letters and_more --before column2
| move letters --after and_more
| move letters and_more --before column2
| rename _ chars_1 chars_2
| get chars_1 chars_2
| str trim
@ -128,7 +128,7 @@ fn moves_columns_after() {
cwd: dirs.test(), pipeline(
r#"
open sample.csv
| move column letters and_more --after column1
| move letters and_more --after column1
| get
| nth 1 2
| str collect