diff --git a/crates/nu-command/src/filters/drop/column.rs b/crates/nu-command/src/filters/drop/column.rs index b34694a20d..a3d5ec7acf 100644 --- a/crates/nu-command/src/filters/drop/column.rs +++ b/crates/nu-command/src/filters/drop/column.rs @@ -26,7 +26,7 @@ impl Command for DropColumn { } fn usage(&self) -> &str { - "Remove N columns at the right-hand end of the input table. To remove columns by name, use 'reject'." + "Remove N columns at the right-hand end of the input table. To remove columns by name, use `reject`." } fn search_terms(&self) -> Vec<&str> { diff --git a/crates/nu-command/src/filters/drop/drop_.rs b/crates/nu-command/src/filters/drop/drop_.rs index 48b3c0ed90..6600d58916 100644 --- a/crates/nu-command/src/filters/drop/drop_.rs +++ b/crates/nu-command/src/filters/drop/drop_.rs @@ -29,7 +29,7 @@ impl Command for Drop { } fn usage(&self) -> &str { - "Remove items/rows from the end of the input list/table. Counterpart of 'skip'. Opposite of 'last'." + "Remove items/rows from the end of the input list/table. Counterpart of `skip`. Opposite of `last`." } fn search_terms(&self) -> Vec<&str> { diff --git a/crates/nu-command/src/filters/first.rs b/crates/nu-command/src/filters/first.rs index 194e85a5f0..535b3dfbc3 100644 --- a/crates/nu-command/src/filters/first.rs +++ b/crates/nu-command/src/filters/first.rs @@ -43,7 +43,7 @@ impl Command for First { } fn usage(&self) -> &str { - "Return only the first several rows of the input. Counterpart of 'last'. Opposite of 'skip'." + "Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`." } fn run( diff --git a/crates/nu-command/src/filters/get.rs b/crates/nu-command/src/filters/get.rs index 8d84e533f8..0ab32c8e39 100644 --- a/crates/nu-command/src/filters/get.rs +++ b/crates/nu-command/src/filters/get.rs @@ -18,6 +18,12 @@ impl Command for Get { "Extract data using a cell path." } + fn extra_usage(&self) -> &str { + r#"This is equivalent to using the cell path access syntax: `$env.OS` is the same as `$env | get OS`. + +If multiple cell paths are given, this will produce a list of values."# + } + fn signature(&self) -> nu_protocol::Signature { Signature::build("get") .input_output_types(vec![ diff --git a/crates/nu-command/src/filters/last.rs b/crates/nu-command/src/filters/last.rs index 7a59f145f3..97a6688a59 100644 --- a/crates/nu-command/src/filters/last.rs +++ b/crates/nu-command/src/filters/last.rs @@ -45,7 +45,7 @@ impl Command for Last { } fn usage(&self) -> &str { - "Return only the last several rows of the input. Counterpart of 'first'. Opposite of 'drop'." + "Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`." } fn examples(&self) -> Vec { diff --git a/crates/nu-command/src/filters/reject.rs b/crates/nu-command/src/filters/reject.rs index e59929fd14..07d321f1f1 100644 --- a/crates/nu-command/src/filters/reject.rs +++ b/crates/nu-command/src/filters/reject.rs @@ -29,7 +29,11 @@ impl Command for Reject { } fn usage(&self) -> &str { - "Remove the given columns from the table. To remove rows, use 'drop'." + "Remove the given columns or rows from the table. Opposite of `select`." + } + + fn extra_usage(&self) -> &str { + "To remove a quantity of rows or columns, use `skip`, `drop`, or `drop column`." } fn run( diff --git a/crates/nu-command/src/filters/select.rs b/crates/nu-command/src/filters/select.rs index f8b7a75cd8..3be756729a 100644 --- a/crates/nu-command/src/filters/select.rs +++ b/crates/nu-command/src/filters/select.rs @@ -35,7 +35,13 @@ impl Command for Select { } fn usage(&self) -> &str { - "Down-select table to only these columns." + "Select only these columns or rows from the input. Opposite of `reject`." + } + + fn extra_usage(&self) -> &str { + r#"This differs from `get` in that, rather than accessing the given value in the data structure, +it removes all non-selected values from the structure. Hence, using `select` on a table will +produce a table, a list will produce a list, and a record will produce a record."# } fn search_terms(&self) -> Vec<&str> { @@ -72,13 +78,13 @@ impl Command for Select { result: Some(Value::test_record(vec!["a"], vec![Value::test_string("a")])), }, Example { - description: "Select just the name column", + description: "Select just the `name` column", example: "ls | select name", result: None, }, Example { - description: "Select the name and size columns", - example: "ls | select name size", + description: "Select the first four rows (this is the same as `first 4`)", + example: "ls | select 0 1 2 3", result: None, }, ] diff --git a/crates/nu-command/src/filters/skip/skip_.rs b/crates/nu-command/src/filters/skip/skip_.rs index 49067c06f6..bfe6a12377 100644 --- a/crates/nu-command/src/filters/skip/skip_.rs +++ b/crates/nu-command/src/filters/skip/skip_.rs @@ -30,11 +30,11 @@ impl Command for Skip { } fn usage(&self) -> &str { - "Skip the first several rows of the input. Counterpart of 'drop'. Opposite of 'first'." + "Skip the first several rows of the input. Counterpart of `drop`. Opposite of `first`." } fn extra_usage(&self) -> &str { - r#"To skip specific numbered rows, try 'drop nth'. To skip specific named columns, try 'reject'."# + r#"To skip specific numbered rows, try `drop nth`. To skip specific named columns, try `reject`."# } fn search_terms(&self) -> Vec<&str> {