mirror of
https://github.com/nushell/nushell.git
synced 2025-08-20 10:38:04 +02:00
Rename the Path and Pattern primitives (#2889)
* Rename the Path primitive to FilePath * Rename glob pattern also * more fun * Fix the Windows path methods
This commit is contained in:
@@ -29,11 +29,11 @@ pub enum InlineShape {
|
||||
String(String),
|
||||
Line(String),
|
||||
ColumnPath(ColumnPath),
|
||||
Pattern(String),
|
||||
GlobPattern(String),
|
||||
Boolean(bool),
|
||||
Date(DateTime<FixedOffset>),
|
||||
Duration(BigInt),
|
||||
Path(PathBuf),
|
||||
FilePath(PathBuf),
|
||||
Binary(usize),
|
||||
|
||||
Row(Row),
|
||||
@@ -72,11 +72,11 @@ impl InlineShape {
|
||||
Primitive::Filesize(bytesize) => InlineShape::Bytesize(*bytesize),
|
||||
Primitive::String(string) => InlineShape::String(string.clone()),
|
||||
Primitive::ColumnPath(path) => InlineShape::ColumnPath(path.clone()),
|
||||
Primitive::Pattern(pattern) => InlineShape::Pattern(pattern.clone()),
|
||||
Primitive::GlobPattern(pattern) => InlineShape::GlobPattern(pattern.clone()),
|
||||
Primitive::Boolean(boolean) => InlineShape::Boolean(*boolean),
|
||||
Primitive::Date(date) => InlineShape::Date(*date),
|
||||
Primitive::Duration(duration) => InlineShape::Duration(duration.clone()),
|
||||
Primitive::Path(path) => InlineShape::Path(path.clone()),
|
||||
Primitive::FilePath(path) => InlineShape::FilePath(path.clone()),
|
||||
Primitive::Binary(b) => InlineShape::Binary(b.len()),
|
||||
Primitive::BeginningOfStream => InlineShape::BeginningOfStream,
|
||||
Primitive::EndOfStream => InlineShape::EndOfStream,
|
||||
@@ -208,7 +208,7 @@ impl PrettyDebug for FormatInlineShape {
|
||||
InlineShape::ColumnPath(path) => {
|
||||
b::intersperse(path.iter().map(|member| member.pretty()), b::keyword("."))
|
||||
}
|
||||
InlineShape::Pattern(pattern) => b::primitive(pattern),
|
||||
InlineShape::GlobPattern(pattern) => b::primitive(pattern),
|
||||
InlineShape::Boolean(boolean) => b::primitive(
|
||||
match (boolean, column) {
|
||||
(true, None) => "Yes",
|
||||
@@ -225,7 +225,7 @@ impl PrettyDebug for FormatInlineShape {
|
||||
&Primitive::Duration(duration.clone()),
|
||||
None,
|
||||
)),
|
||||
InlineShape::Path(path) => b::primitive(path.display()),
|
||||
InlineShape::FilePath(path) => b::primitive(path.display()),
|
||||
InlineShape::Binary(length) => b::opaque(format!("<binary: {} bytes>", length)),
|
||||
InlineShape::Row(row) => b::delimit(
|
||||
"[",
|
||||
|
Reference in New Issue
Block a user