forked from extern/nushell
Path commands: Put column path args behid flag; Allow path join
appending without flag (#4008)
* Change path join signature * Appending now works without flag * Column path operation is behind a -c flag * Move column path arg retrieval to a function Also improves errors * Fix path join tests * Propagate column path changes to all path commands * Update path command examples with columns paths * Modernize path command examples by removing "echo" * Improve structured path error message * Fix typo
This commit is contained in:
@ -48,7 +48,7 @@ fn parses_custom_extension_gets_extension() {
|
||||
let actual = nu!(
|
||||
cwd: "tests", pipeline(
|
||||
r#"
|
||||
echo 'home/viking/spam.tar.gz'
|
||||
echo 'home/viking/spam.tar.gz'
|
||||
| path parse -e tar.gz
|
||||
| get extension
|
||||
"#
|
||||
@ -62,7 +62,7 @@ fn parses_custom_extension_gets_stem() {
|
||||
let actual = nu!(
|
||||
cwd: "tests", pipeline(
|
||||
r#"
|
||||
echo 'home/viking/spam.tar.gz'
|
||||
echo 'home/viking/spam.tar.gz'
|
||||
| path parse -e tar.gz
|
||||
| get stem
|
||||
"#
|
||||
@ -76,7 +76,7 @@ fn parses_ignoring_extension_gets_extension() {
|
||||
let actual = nu!(
|
||||
cwd: "tests", pipeline(
|
||||
r#"
|
||||
echo 'home/viking/spam.tar.gz'
|
||||
echo 'home/viking/spam.tar.gz'
|
||||
| path parse -e ''
|
||||
| get extension
|
||||
"#
|
||||
@ -90,7 +90,7 @@ fn parses_ignoring_extension_gets_stem() {
|
||||
let actual = nu!(
|
||||
cwd: "tests", pipeline(
|
||||
r#"
|
||||
echo 'home/viking/spam.tar.gz'
|
||||
echo 'home/viking/spam.tar.gz'
|
||||
| path parse -e ""
|
||||
| get stem
|
||||
"#
|
||||
@ -105,7 +105,7 @@ fn parses_column_path_extension() {
|
||||
cwd: "tests", pipeline(
|
||||
r#"
|
||||
echo [[home, barn]; ['home/viking/spam.txt', 'barn/cow/moo.png']]
|
||||
| path parse home barn
|
||||
| path parse -c [ home barn ]
|
||||
| get barn
|
||||
| get extension
|
||||
"#
|
||||
|
Reference in New Issue
Block a user