mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 00:16:10 +02:00
Edited help text and examples in explore
for readability (#7324)
# Description * Various help messages were edited for clarity/grammar/etc. * Some examples were made more interesting or relevant # User-Facing Changes See above. # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date.
This commit is contained in:
@@ -64,16 +64,16 @@ impl ViewCommand for HelpCmd {
|
||||
fn help(&self) -> Option<HelpManual> {
|
||||
Some(HelpManual {
|
||||
name: "help",
|
||||
description: "Looks up a help information about a command or a `explore`",
|
||||
description: "Explore the help page for `explore`",
|
||||
arguments: vec![],
|
||||
examples: vec![
|
||||
HelpExample {
|
||||
example: "help",
|
||||
description: "Open a help information about the `explore`",
|
||||
description: "Open the help page for all of `explore`",
|
||||
},
|
||||
HelpExample {
|
||||
example: "help nu",
|
||||
description: "Find a help list of `nu` command",
|
||||
description: "Open the help page for the `nu` explore command",
|
||||
},
|
||||
HelpExample {
|
||||
example: "help help",
|
||||
@@ -161,20 +161,20 @@ fn help_frame_data(
|
||||
|
||||
#[rustfmt::skip]
|
||||
let shortcuts = [
|
||||
(":", "view", commands, "Run a command"),
|
||||
("/", "view", null!(), "Search via pattern"),
|
||||
("?", "view", null!(), "Search via pattern but results will be reversed when you press <n>"),
|
||||
("n", "view", null!(), "Gets to the next found element in search"),
|
||||
("i", "view", null!(), "Turn on a cursor mode so you can inspect values"),
|
||||
("t", "view", null!(), "Transpose table, so columns became rows and vice versa"),
|
||||
("Up", "", null!(), "Moves to an element above"),
|
||||
("Down", "", null!(), "Moves to an element bellow"),
|
||||
("Left", "", null!(), "Moves to an element to the left"),
|
||||
("Right", "", null!(), "Moves to an element to the right"),
|
||||
("PgDown", "view", null!(), "Moves to an a bunch of elements bellow"),
|
||||
("PgUp", "view", null!(), "Moves to an a bunch of elements above"),
|
||||
("Esc", "", null!(), "Exits a cursor mode. Exists an expected element."),
|
||||
("Enter", "cursor", null!(), "Inspect a chosen element"),
|
||||
(":", "view", commands, "Run an explore command (explore the 'information' cell of this row to list commands)"),
|
||||
("/", "view", null!(), "Search for a pattern"),
|
||||
("?", "view", null!(), "Search for a pattern, but the <n> key now scrolls to the previous result"),
|
||||
("n", "view", null!(), "When searching, scroll to the next search result"),
|
||||
("i", "view", null!(), "Enters cursor mode to inspect individual cells"),
|
||||
("t", "view", null!(), "Transpose table, so that columns become rows and vice versa"),
|
||||
("Up", "", null!(), "Moves the cursor or viewport one row up"),
|
||||
("Down", "", null!(), "Moves the cursor or viewport one row down"),
|
||||
("Left", "", null!(), "Moves the cursor or viewport one column left"),
|
||||
("Right", "", null!(), "Moves the cursor or viewport one column right"),
|
||||
("PgDown", "view", null!(), "Moves the cursor or viewport one page of rows down"),
|
||||
("PgUp", "view", null!(), "Moves the cursor or viewport one page of rows up"),
|
||||
("Esc", "", null!(), "Exits cursor mode. Exits the currently explored data."),
|
||||
("Enter", "cursor", null!(), "In cursor mode, explore the data of the selected cell"),
|
||||
];
|
||||
|
||||
let headers = headers.iter().map(|s| s.to_string()).collect();
|
||||
|
@@ -44,16 +44,17 @@ impl ViewCommand for NuCmd {
|
||||
fn help(&self) -> Option<HelpManual> {
|
||||
Some(HelpManual {
|
||||
name: "nu",
|
||||
description: "Run a nu command. You can use a presented table as an input",
|
||||
description:
|
||||
"Run a Nushell command. The data currently being explored is piped into it.",
|
||||
arguments: vec![],
|
||||
examples: vec![
|
||||
HelpExample {
|
||||
example: "where type == 'file'",
|
||||
description: "Filter data to get only entries with a type being a 'file'",
|
||||
description: "Filter data to show only rows whose type is 'file'",
|
||||
},
|
||||
HelpExample {
|
||||
example: "get scope | get examples",
|
||||
description: "Get a inner values",
|
||||
example: "get scope.examples",
|
||||
description: "Navigate to a deeper value inside the data",
|
||||
},
|
||||
HelpExample {
|
||||
example: "open Cargo.toml",
|
||||
|
@@ -40,7 +40,8 @@ impl ViewCommand for PreviewCmd {
|
||||
fn help(&self) -> Option<HelpManual> {
|
||||
Some(HelpManual {
|
||||
name: "preview",
|
||||
description: "Preview current value/table if any is currently in use",
|
||||
description:
|
||||
"View the currently selected cell's data using the `table` Nushell command",
|
||||
arguments: vec![],
|
||||
examples: vec![],
|
||||
})
|
||||
|
@@ -28,7 +28,7 @@ impl SimpleCommand for QuitCmd {
|
||||
fn help(&self) -> Option<HelpManual> {
|
||||
Some(HelpManual {
|
||||
name: "quit",
|
||||
description: "Quit",
|
||||
description: "Quit and return to Nushell",
|
||||
arguments: vec![],
|
||||
examples: vec![],
|
||||
})
|
||||
|
@@ -40,11 +40,11 @@ impl ViewCommand for TryCmd {
|
||||
fn help(&self) -> Option<HelpManual> {
|
||||
Some(HelpManual {
|
||||
name: "try",
|
||||
description: "Opens a dynamic REPL to run nu commands",
|
||||
description: "Opens a panel in which to run Nushell commands and explore their output",
|
||||
arguments: vec![],
|
||||
examples: vec![HelpExample {
|
||||
example: "try open Cargo.toml",
|
||||
description: "Optionally you can provide a command which will be run right away",
|
||||
description: "Optionally, you can provide a command which will be run immediately",
|
||||
}],
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user