From 90d0182a54f7b11668e519140cf9718d40280f08 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Mon, 3 Jun 2019 06:53:30 +1200 Subject: [PATCH] Rename to first and pick --- README.md | 4 ++-- src/cli.rs | 4 ++-- src/commands.rs | 4 ++-- src/commands/{take.rs => first.rs} | 2 +- src/commands/{column.rs => pick.rs} | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename src/commands/{take.rs => first.rs} (79%) rename src/commands/{column.rs => pick.rs} (89%) diff --git a/README.md b/README.md index 5cd735ba4..9b859bc69 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ At the moment, executing a command that isn't identified as a built-in new comma ## Commands on tables | command | description | | ------------- | ------------- | -| column ...columns | Down-select table to only these columns | +| pick ...columns | Down-select table to only these columns | | reject ...columns | Remove the given columns from the table | | select column-or-column-path | Open given cells as text | | sort-by ...columns | Sort by the given columns | @@ -125,7 +125,7 @@ The name of the columns in the table can be used to sort the table. You can also use the names of the columns to down-select to only the data you want. ```text -~\Code\nushell> ls | column "file name" "file type" size | sort-by "file type" +~\Code\nushell> ls | pick "file name" "file type" size | sort-by "file type" ------------------------------------ file name file type size ------------------------------------ diff --git a/src/cli.rs b/src/cli.rs index 8d3f88266..967e942ce 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -48,12 +48,12 @@ pub async fn cli() -> Result<(), Box> { command("cd", cd::cd), command("view", view::view), command("skip", skip::skip), - command("first", take::take), + command("first", first::first), command("size", size::size), command("from-json", from_json::from_json), command("from-toml", from_toml::from_toml), command("open", open::open), - command("column", column::column), + command("pick", pick::pick), command("split-column", split_column::split_column), command("split-row", split_row::split_row), command("reject", reject::reject), diff --git a/src/commands.rs b/src/commands.rs index 9aca425f7..fa3c307fd 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,7 +1,7 @@ crate mod args; crate mod cd; crate mod classified; -crate mod column; +crate mod pick; crate mod command; crate mod config; crate mod from_json; @@ -16,7 +16,7 @@ crate mod skip; crate mod sort_by; crate mod split_column; crate mod split_row; -crate mod take; +crate mod first; crate mod to_array; crate mod to_json; crate mod to_toml; diff --git a/src/commands/take.rs b/src/commands/first.rs similarity index 79% rename from src/commands/take.rs rename to src/commands/first.rs index 03ac49226..9f7748ced 100644 --- a/src/commands/take.rs +++ b/src/commands/first.rs @@ -3,7 +3,7 @@ use crate::prelude::*; // TODO: "Amount remaining" wrapper -pub fn take(args: CommandArgs) -> Result { +pub fn first(args: CommandArgs) -> Result { let amount = args.positional[0].as_i64()?; let input = args.input; diff --git a/src/commands/column.rs b/src/commands/pick.rs similarity index 89% rename from src/commands/column.rs rename to src/commands/pick.rs index 3e811771e..7cbf08536 100644 --- a/src/commands/column.rs +++ b/src/commands/pick.rs @@ -3,7 +3,7 @@ use crate::object::base::select_fields; use crate::object::Value; use crate::prelude::*; -pub fn column(args: CommandArgs) -> Result { +pub fn pick(args: CommandArgs) -> Result { if args.positional.is_empty() { return Err(ShellError::string("select requires a field")); }