mirror of
https://github.com/nushell/nushell.git
synced 2024-12-22 23:23:12 +01:00
Rename to first and pick
This commit is contained in:
parent
d7bd35e7fd
commit
90d0182a54
@ -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
|
||||
------------------------------------
|
||||
|
@ -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),
|
||||
|
@ -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;
|
||||
|
@ -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;
|
@ -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"));
|
||||
}
|
Loading…
Reference in New Issue
Block a user