mirror of
https://github.com/nushell/nushell
synced 2024-12-26 13:03:07 +00:00
Rename to first and pick
This commit is contained in:
parent
d7bd35e7fd
commit
90d0182a54
5 changed files with 8 additions and 8 deletions
|
@ -19,7 +19,7 @@ At the moment, executing a command that isn't identified as a built-in new comma
|
||||||
## Commands on tables
|
## Commands on tables
|
||||||
| command | description |
|
| 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 |
|
| reject ...columns | Remove the given columns from the table |
|
||||||
| select column-or-column-path | Open given cells as text |
|
| select column-or-column-path | Open given cells as text |
|
||||||
| sort-by ...columns | Sort by the given columns |
|
| 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.
|
You can also use the names of the columns to down-select to only the data you want.
|
||||||
```text
|
```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
|
file name file type size
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
|
@ -48,12 +48,12 @@ pub async fn cli() -> Result<(), Box<Error>> {
|
||||||
command("cd", cd::cd),
|
command("cd", cd::cd),
|
||||||
command("view", view::view),
|
command("view", view::view),
|
||||||
command("skip", skip::skip),
|
command("skip", skip::skip),
|
||||||
command("first", take::take),
|
command("first", first::first),
|
||||||
command("size", size::size),
|
command("size", size::size),
|
||||||
command("from-json", from_json::from_json),
|
command("from-json", from_json::from_json),
|
||||||
command("from-toml", from_toml::from_toml),
|
command("from-toml", from_toml::from_toml),
|
||||||
command("open", open::open),
|
command("open", open::open),
|
||||||
command("column", column::column),
|
command("pick", pick::pick),
|
||||||
command("split-column", split_column::split_column),
|
command("split-column", split_column::split_column),
|
||||||
command("split-row", split_row::split_row),
|
command("split-row", split_row::split_row),
|
||||||
command("reject", reject::reject),
|
command("reject", reject::reject),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
crate mod args;
|
crate mod args;
|
||||||
crate mod cd;
|
crate mod cd;
|
||||||
crate mod classified;
|
crate mod classified;
|
||||||
crate mod column;
|
crate mod pick;
|
||||||
crate mod command;
|
crate mod command;
|
||||||
crate mod config;
|
crate mod config;
|
||||||
crate mod from_json;
|
crate mod from_json;
|
||||||
|
@ -16,7 +16,7 @@ crate mod skip;
|
||||||
crate mod sort_by;
|
crate mod sort_by;
|
||||||
crate mod split_column;
|
crate mod split_column;
|
||||||
crate mod split_row;
|
crate mod split_row;
|
||||||
crate mod take;
|
crate mod first;
|
||||||
crate mod to_array;
|
crate mod to_array;
|
||||||
crate mod to_json;
|
crate mod to_json;
|
||||||
crate mod to_toml;
|
crate mod to_toml;
|
||||||
|
|
|
@ -3,7 +3,7 @@ use crate::prelude::*;
|
||||||
|
|
||||||
// TODO: "Amount remaining" wrapper
|
// 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 amount = args.positional[0].as_i64()?;
|
||||||
|
|
||||||
let input = args.input;
|
let input = args.input;
|
|
@ -3,7 +3,7 @@ use crate::object::base::select_fields;
|
||||||
use crate::object::Value;
|
use crate::object::Value;
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
|
||||||
pub fn column(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
pub fn pick(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||||
if args.positional.is_empty() {
|
if args.positional.is_empty() {
|
||||||
return Err(ShellError::string("select requires a field"));
|
return Err(ShellError::string("select requires a field"));
|
||||||
}
|
}
|
Loading…
Reference in a new issue