Add long options for path (#10775)

This commit is contained in:
Hofer-Julian
2023-10-19 22:07:01 +02:00
committed by GitHub
parent 4fd2b702ee
commit 11480c77be
8 changed files with 27 additions and 26 deletions

View File

@ -21,7 +21,7 @@ fn replaces_basename_of_empty_input() {
cwd: "tests", pipeline(
r#"
echo ""
| path basename -r newname.txt
| path basename --replace newname.txt
"#
));
@ -47,7 +47,7 @@ fn replaces_basename_of_path_ending_with_dot() {
cwd: "tests", pipeline(
r#"
echo "some/file.txt/."
| path basename -r viking.txt
| path basename --replace viking.txt
"#
));
@ -74,7 +74,7 @@ fn replaces_basename_of_path_ending_with_double_dot() {
cwd: "tests", pipeline(
r#"
echo "some/file.txt/.."
| path basename -r eggs
| path basename --replace eggs
"#
));

View File

@ -21,7 +21,7 @@ fn replaces_dirname_of_empty_input() {
cwd: "tests", pipeline(
r#"
echo ""
| path dirname -r newdir
| path dirname --replace newdir
"#
));
@ -47,7 +47,7 @@ fn replaces_dirname_of_path_ending_with_dot() {
cwd: "tests", pipeline(
r#"
echo "some/dir/."
| path dirname -r eggs
| path dirname --replace eggs
"#
));
@ -74,7 +74,7 @@ fn replaces_dirname_of_path_with_double_dot() {
cwd: "tests", pipeline(
r#"
echo "some/dir/.."
| path dirname -r eggs
| path dirname --replace eggs
"#
));
@ -88,7 +88,7 @@ fn returns_dirname_of_zero_levels() {
cwd: "tests", pipeline(
r#"
echo "some/dir/with/spam.txt"
| path dirname -n 0
| path dirname --num-levels 0
"#
));
@ -101,7 +101,7 @@ fn replaces_dirname_of_zero_levels_with_empty_string() {
cwd: "tests", pipeline(
r#"
echo "some/dir/with/spam.txt"
| path dirname -n 0 -r ""
| path dirname --num-levels 0 --replace ""
"#
));
@ -114,7 +114,7 @@ fn replaces_dirname_of_more_levels() {
cwd: "tests", pipeline(
r#"
echo "some/dir/with/spam.txt"
| path dirname -r eggs -n 2
| path dirname --replace eggs -n 2
"#
));
@ -128,7 +128,7 @@ fn replaces_dirname_of_way_too_many_levels() {
cwd: "tests", pipeline(
r#"
echo "some/dir/with/spam.txt"
| path dirname -r eggs -n 999
| path dirname --replace eggs -n 999
"#
));

View File

@ -49,7 +49,7 @@ fn parses_custom_extension_gets_extension() {
cwd: "tests", pipeline(
r#"
echo 'home/viking/spam.tar.gz'
| path parse -e tar.gz
| path parse --extension tar.gz
| get extension
"#
));
@ -63,7 +63,7 @@ fn parses_custom_extension_gets_stem() {
cwd: "tests", pipeline(
r#"
echo 'home/viking/spam.tar.gz'
| path parse -e tar.gz
| path parse --extension tar.gz
| get stem
"#
));
@ -77,7 +77,7 @@ fn parses_ignoring_extension_gets_extension() {
cwd: "tests", pipeline(
r#"
echo 'home/viking/spam.tar.gz'
| path parse -e ''
| path parse --extension ''
| get extension
"#
));
@ -91,7 +91,7 @@ fn parses_ignoring_extension_gets_stem() {
cwd: "tests", pipeline(
r#"
echo 'home/viking/spam.tar.gz'
| path parse -e ""
| path parse --extension ""
| get stem
"#
));