Replace all instances of 'column path' in help messages with 'cell path' (#7063)

* Rewrite all 'column path' instances to 'cell path'

* Minor tweak
This commit is contained in:
Leon 2022-11-10 15:49:11 +10:00 committed by GitHub
parent bb0d08a721
commit 921a66554e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 71 additions and 73 deletions

View File

@ -43,7 +43,7 @@ impl Command for BytesAdd {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally matches prefix of text by column paths",
"for a data structure input, add bytes to the data at the given cell paths",
)
.category(Category::Bytes)
}

View File

@ -121,7 +121,7 @@ impl Command for BytesAt {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally get bytes by column paths",
"for a data structure input, get bytes from data at the given cell paths",
)
.category(Category::Bytes)
}

View File

@ -33,7 +33,7 @@ impl Command for BytesEndsWith {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally matches prefix of text by column paths",
"for a data structure input, check if bytes at the given cell paths end with the pattern",
)
.category(Category::Bytes)
}

View File

@ -41,7 +41,7 @@ impl Command for BytesIndexOf {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally returns index of pattern in string by column paths",
"for a data structure input, find the indexes at the given cell paths",
)
.switch("all", "returns all matched index", Some('a'))
.switch("end", "search from the end of the binary", Some('e'))

View File

@ -21,7 +21,7 @@ impl Command for BytesLen {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally find length of binary by column paths",
"for a data structure input, find the length of data at the given cell paths",
)
.category(Category::Bytes)
}

View File

@ -35,7 +35,7 @@ impl Command for BytesRemove {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally remove bytes by column paths",
"for a data structure input, remove bytes from data at the given cell paths",
)
.switch("end", "remove from end of binary", Some('e'))
.switch("all", "remove occurrences of finding binary", Some('a'))

View File

@ -36,7 +36,7 @@ impl Command for BytesReplace {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally find and replace text by column paths",
"for a data structure input, replace bytes in data at the given cell paths",
)
.switch("all", "replace all occurrences of find binary", Some('a'))
.category(Category::Bytes)

View File

@ -21,13 +21,13 @@ impl Command for BytesReverse {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally matches prefix of text by column paths",
"for a data structure input, reverse data at the given cell paths",
)
.category(Category::Bytes)
}
fn usage(&self) -> &str {
"Reverse every bytes in the pipeline"
"Reverse the bytes in the pipeline"
}
fn search_terms(&self) -> Vec<&str> {

View File

@ -33,7 +33,7 @@ impl Command for BytesStartsWith {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally matches prefix of text by column paths",
"for a data structure input, check if bytes at the given cell paths start with the pattern",
)
.category(Category::Bytes)
}

View File

@ -30,7 +30,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"column paths to convert to binary (for table input)",
"for a data structure input, convert data at the given cell paths",
)
.category(Category::Conversions)
}

View File

@ -26,7 +26,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"column paths to convert to boolean (for table input)",
"for a data structure input, convert data at the given cell paths",
)
.category(Category::Conversions)
}

View File

@ -94,7 +94,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally convert text into datetime by column paths",
"for a data structure input, convert data at the given cell paths",
)
.category(Category::Conversions)
}

View File

@ -23,7 +23,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally convert text into decimal by column paths",
"for a data structure input, convert data at the given cell paths",
)
}

View File

@ -33,7 +33,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"column paths to convert to duration (for table input)",
"for a data structure input, convert data at the given cell paths",
)
.category(Category::Conversions)
}

View File

@ -25,7 +25,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"column paths to convert to filesize (for table input)",
"for a data structure input, convert data at the given cell paths",
)
.category(Category::Conversions)
}

View File

@ -43,7 +43,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"column paths to convert to int (for table input)",
"for a data structure input, convert data at the given cell paths",
)
.category(Category::Conversions)
}

View File

@ -42,11 +42,10 @@ impl Command for SubCommand {
(Type::Date, Type::String),
])
.allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032
// FIXME - need to support column paths
.rest(
"rest",
SyntaxShape::CellPath,
"column paths to convert to string (for table input)",
"for a data structure input, convert data at the given cell paths",
)
.named(
"decimals",

View File

@ -33,7 +33,7 @@ impl From<Vec<CellPath>> for CellPathOnlyArgs {
///
/// In detail, for each elements, invoking relative `cmd` with `arg`.
///
/// If `arg` tell us that it's column path is not None, only map over data under these columns.
/// If `arg` tell us that its cell path is not None, only map over data under these columns.
/// Else it will apply each column inside a table.
///
/// The validation of input element should be handle by `cmd` itself.

View File

@ -313,9 +313,9 @@ tutor each
fn each_tutor() -> &'static str {
r#"
The `each` command gives us a way of working with each individual row or
element of a list one at a time. It reads these in from the pipeline and
runs a block on each element. A block is a group of pipelines.
The `each` command gives us a way of working with the individual elements
(sometimes called 'rows') of a list one at a time. It reads these in from
the pipeline and runs a block on each one. A block is a group of pipelines.
```
echo 1 2 3 | each { |it| $it + 10}
```
@ -375,9 +375,9 @@ second block if the expression is false.
fn shorthand_tutor() -> &'static str {
r#"
You can access cells in a table using a shorthand notation sometimes called a
"column path" or "cell path". These paths allow you to go from a table to
rows, columns, or cells inside of the table.
You can access data in a structure via a shorthand notation called a "cell path",
sometimes called a "column path". These paths allow you to go from a structure to
rows, columns, or cells inside of the structure.
Shorthand paths are made from rows numbers, column names, or both. You can use
them on any variable or subexpression.
@ -392,8 +392,8 @@ the shorthand path to retrieve only the cell data inside the "PWD" column.
This will retrieve the cell data in the "name" column on the 5th row (note:
row numbers are zero-based).
Rows and columns don't need to come in any specific order. You can get the
same value using:
For tables, rows and columns don't need to come in any specific order. You can
produce the same value using:
```
(ls).4.name
```

View File

@ -34,7 +34,7 @@ impl Command for SubCommand {
.named(
"columns",
SyntaxShape::Table,
"Optionally operate by column path",
"For a record or table input, convert strings in the given columns to their basename",
Some('c'),
)
.named(

View File

@ -31,7 +31,7 @@ impl Command for SubCommand {
.named(
"columns",
SyntaxShape::Table,
"Optionally operate by column path",
"For a record or table input, convert strings at the given columns to their dirname",
Some('c'),
)
.named(

View File

@ -31,7 +31,7 @@ impl Command for SubCommand {
.named(
"columns",
SyntaxShape::Table,
"Optionally operate by column path",
"For a record or table input, check strings at the given columns, and replace with result",
Some('c'),
)
}

View File

@ -42,7 +42,7 @@ impl Command for SubCommand {
.named(
"columns",
SyntaxShape::Table,
"Optionally operate by column path",
"For a record or table input, expand strings at the given columns",
Some('c'),
)
}

View File

@ -40,7 +40,7 @@ impl Command for SubCommand {
.named(
"columns",
SyntaxShape::Table,
"Optionally operate by column path",
"For a record or table input, join strings at the given columns",
Some('c'),
)
.rest("append", SyntaxShape::String, "Path to append to the input")

View File

@ -33,7 +33,7 @@ impl Command for SubCommand {
.named(
"columns",
SyntaxShape::Table,
"Optionally operate by column path",
"For a record or table input, convert strings at the given columns",
Some('c'),
)
.named(

View File

@ -38,13 +38,13 @@ impl Command for SubCommand {
.named(
"columns",
SyntaxShape::Table,
"Optionally operate by column path",
"For a record or table input, convert strings at the given columns",
Some('c'),
)
}
fn usage(&self) -> &str {
"Get a path as relative to another path."
"Express a path as relative to another path."
}
fn extra_usage(&self) -> &str {

View File

@ -31,7 +31,7 @@ impl Command for SubCommand {
.named(
"columns",
SyntaxShape::Table,
"Optionally operate by column path",
"For a record or table input, split strings at the given columns",
Some('c'),
)
}

View File

@ -31,7 +31,7 @@ impl Command for SubCommand {
.named(
"columns",
SyntaxShape::Table,
"Optionally operate by column path",
"For a record or table input, check strings at the given columns, and replace with result",
Some('c'),
)
}

View File

@ -39,15 +39,15 @@ impl Command for SubCommand {
Some('d'),
)
.rest(
"column path",
"cell path",
SyntaxShape::CellPath,
"optionally, draw gradients using text from column paths",
"for a data structure input, add a gradient to strings at the given cell paths",
)
.category(Category::Platform)
}
fn usage(&self) -> &str {
"Draw text with a provided start and end code making a gradient"
"Add a color gradient (using ANSI color codes) to the given string"
}
fn run(

View File

@ -16,9 +16,9 @@ impl Command for SubCommand {
Signature::build("ansi strip")
.input_output_types(vec![(Type::String, Type::String)])
.rest(
"column path",
"cell path",
SyntaxShape::CellPath,
"optionally, remove ANSI sequences by column paths",
"for a data structure input, remove ANSI sequences from strings at the given cell paths",
)
.category(Category::Platform)
}

View File

@ -34,7 +34,7 @@ impl Command for DecodeBase64 {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally base64 decode data by column paths",
"For a data structure input, decode data at the given cell paths",
)
.category(Category::Hash)
}

View File

@ -26,7 +26,7 @@ impl Command for EncodeBase64 {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally base64 encode data by column paths",
"For a data structure input, encode data at the given cell paths",
)
.output_type(Type::String)
.category(Category::Hash)

View File

@ -37,7 +37,7 @@ impl Command for FileSize {
.rest(
"rest",
SyntaxShape::CellPath,
"Optionally find and replace text by column paths",
"For a data structure input, format filesizes at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -22,7 +22,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally convert text to camelCase by column paths",
"For a data structure input, convert strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -20,7 +20,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally capitalize text by column paths",
"For a data structure input, convert strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -20,7 +20,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally downcase text by column paths",
"For a data structure input, convert strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -22,7 +22,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally convert text to kebab-case by column paths",
"For a data structure input, convert strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -22,7 +22,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally convert text to PascalCase by column paths",
"For a data structure input, convert strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -21,7 +21,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally convert text to SCREAMING_SNAKE_CASE by column paths",
"For a data structure input, convert strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -21,7 +21,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally convert text to snake_case by column paths",
"For a data structure input, convert strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -22,7 +22,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally convert text to Title Case by column paths",
"For a data structure input, convert strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -19,7 +19,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally upcase text by column paths",
"For a data structure input, convert strings at the given cell paths",
)
}

View File

@ -31,11 +31,11 @@ impl Command for SubCommand {
Signature::build("str contains")
.input_output_types(vec![(Type::String, Type::Bool)])
.vectorizes_over_list(true)
.required("string", SyntaxShape::String, "the string to find")
.required("string", SyntaxShape::String, "the substring to find")
.rest(
"rest",
SyntaxShape::CellPath,
"optionally check if input contains string by column paths",
"For a data structure input, check strings at the given cell paths, and replace with result",
)
.switch("insensitive", "search is case insensitive", Some('i'))
.switch("not", "does not contain", Some('n'))
@ -43,7 +43,7 @@ impl Command for SubCommand {
}
fn usage(&self) -> &str {
"Checks if input contains string"
"Checks if string input contains a substring"
}
fn search_terms(&self) -> Vec<&str> {

View File

@ -37,7 +37,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally check if string contains pattern by column paths",
"For a data structure input, check strings at the given cell paths, and replace with result",
)
.category(Category::Strings)
}

View File

@ -33,7 +33,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally matches suffix of text by cell paths",
"For a data structure input, check strings at the given cell paths, and replace with result",
)
.category(Category::Strings)
}

View File

@ -39,7 +39,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally returns index of string in input by column paths",
"For a data structure input, search strings at the given cell paths, and replace with result",
)
.named(
"range",

View File

@ -20,7 +20,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally find length of text by column paths",
"For a data structure input, replace strings at the given cell paths with their length",
)
.category(Category::Strings)
}

View File

@ -40,7 +40,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally check if string contains pattern by column paths",
"For a data structure input, pad strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -40,7 +40,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally find and replace text by column paths",
"For a data structure input, operate on strings at the given cell paths",
)
.switch("all", "replace all occurrences of find string", Some('a'))
.switch(

View File

@ -21,7 +21,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally reverse text by column paths",
"For a data structure input, reverse strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -40,7 +40,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally check if string contains pattern by column paths",
"For a data structure input, pad strings at the given cell paths",
)
.category(Category::Strings)
}

View File

@ -35,7 +35,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally matches prefix of text by column paths",
"For a data structure input, check strings at the given cell paths, and replace with result",
)
.category(Category::Strings)
}

View File

@ -48,7 +48,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally substring text by column paths",
"For a data structure input, turn strings at the given cell paths into substrings",
)
}

View File

@ -44,8 +44,7 @@ impl Command for SubCommand {
.rest(
"rest",
SyntaxShape::CellPath,
"optionally trim text by column paths",
)
"For a data structure input, trim strings at the given cell paths", )
.named(
"char",
SyntaxShape::String,

View File

@ -608,7 +608,7 @@ impl Value {
Value::Nothing { span }
}
/// Follow a given column path into the value: for example accessing select elements in a stream or list
/// Follow a given cell path into the value: for example accessing select elements in a stream or list
pub fn follow_cell_path(
self,
cell_path: &[PathMember],
@ -750,7 +750,7 @@ impl Value {
Ok(current)
}
/// Follow a given column path into the value: for example accessing select elements in a stream or list
/// Follow a given cell path into the value: for example accessing select elements in a stream or list
pub fn upsert_cell_path(
&mut self,
cell_path: &[PathMember],
@ -863,7 +863,7 @@ impl Value {
Ok(())
}
/// Follow a given column path into the value: for example accessing select elements in a stream or list
/// Follow a given cell path into the value: for example accessing select elements in a stream or list
pub fn update_cell_path(
&mut self,
cell_path: &[PathMember],