Merge pull request #73 from jonathandturner/rename_cmds

Rename to first and pick
This commit is contained in:
Jonathan Turner 2019-06-03 06:54:26 +12:00 committed by GitHub
commit fcd5ff9450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -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
------------------------------------

View File

@ -48,12 +48,12 @@ pub async fn cli() -> Result<(), Box<Error>> {
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),

View File

@ -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;

View File

@ -3,7 +3,7 @@ use crate::prelude::*;
// TODO: "Amount remaining" wrapper
pub fn take(args: CommandArgs) -> Result<OutputStream, ShellError> {
pub fn first(args: CommandArgs) -> Result<OutputStream, ShellError> {
let amount = args.positional[0].as_i64()?;
let input = args.input;

View File

@ -3,7 +3,7 @@ use crate::object::base::select_fields;
use crate::object::Value;
use crate::prelude::*;
pub fn column(args: CommandArgs) -> Result<OutputStream, ShellError> {
pub fn pick(args: CommandArgs) -> Result<OutputStream, ShellError> {
if args.positional.is_empty() {
return Err(ShellError::string("select requires a field"));
}