forked from extern/nushell
add -n for path expand, so it doesn't follow symlink (#6255)
* add -p for path expand, so it doesn't follow symlink * fix arg name * rename from no-dereferenct to no-follow-link * rename from no-follow-link to no-symlink, and change short -p to -n * follow strict first * fix * simplify test * fix clippy * fix test on windows
This commit is contained in:
@ -57,9 +57,9 @@ impl Command for Cp {
|
||||
// .switch("force", "suppress error when no file", Some('f'))
|
||||
.switch("interactive", "ask user to confirm action", Some('i'))
|
||||
.switch(
|
||||
"no-dereference",
|
||||
"If the -r option is specified, no symbolic links are followed.",
|
||||
Some('p'),
|
||||
"no-symlink",
|
||||
"no symbolic links are followed, only works if -r is active",
|
||||
Some('n'),
|
||||
)
|
||||
.category(Category::FileSystem)
|
||||
}
|
||||
@ -218,7 +218,7 @@ impl Command for Cp {
|
||||
)
|
||||
})?;
|
||||
|
||||
let not_follow_symlink = call.has_flag("no-dereference");
|
||||
let not_follow_symlink = call.has_flag("no-symlink");
|
||||
let sources = sources.paths_applying_with(|(source_file, depth_level)| {
|
||||
let mut dest = destination.clone();
|
||||
|
||||
|
Reference in New Issue
Block a user