Merge skip command varieties into one command with sub commands. (#2179)

This commit is contained in:
Andrés N. Robalino
2020-07-14 20:44:49 -05:00
committed by GitHub
parent 5f1075544c
commit 71e55541d7
11 changed files with 38 additions and 34 deletions

View File

@ -37,7 +37,7 @@ fn condition_is_met() {
| skip 2
| split column ','
| headers
| skip-while "Chicken Collection" != "Blue Chickens"
| skip while "Chicken Collection" != "Blue Chickens"
| keep-until "Chicken Collection" == "Red Chickens"
| skip 1
| str to-int "31/04/2020"

View File

@ -7,7 +7,7 @@ fn lines() {
r#"
open cargo_sample.toml -r
| lines
| skip-while $it != "[dependencies]"
| skip while $it != "[dependencies]"
| skip 1
| first 1
| split column "="

View File

@ -43,8 +43,7 @@ mod rm;
mod save;
mod select;
mod semicolon;
mod skip_until;
mod skip_while;
mod skip;
mod sort_by;
mod split_by;
mod split_column;

View File

@ -0,0 +1,2 @@
mod until;
mod while_;

View File

@ -4,7 +4,7 @@ use nu_test_support::{nu, pipeline};
#[test]
fn condition_is_met() {
Playground::setup("skip-until_test_1", |dirs, sandbox| {
Playground::setup("skip_until_test_1", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContentToBeTrimmed(
"caballeros.txt",
r#"
@ -37,7 +37,7 @@ fn condition_is_met() {
| skip 2
| split column ','
| headers
| skip-until "Chicken Collection" == "Red Chickens"
| skip until "Chicken Collection" == "Red Chickens"
| skip 1
| str to-int "31/04/2020"
| get "31/04/2020"

View File

@ -4,7 +4,7 @@ use nu_test_support::{nu, pipeline};
#[test]
fn condition_is_met() {
Playground::setup("skip-while_test_1", |dirs, sandbox| {
Playground::setup("skip_while_test_1", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContentToBeTrimmed(
"caballeros.txt",
r#"
@ -37,7 +37,7 @@ fn condition_is_met() {
| skip 2
| split column ','
| headers
| skip-while "Chicken Collection" != "Red Chickens"
| skip while "Chicken Collection" != "Red Chickens"
| skip 1
| str to-int "31/04/2020"
| get "31/04/2020"