nushell/crates/nu-command/src
David Matos 7827b1fb87
ucp: Change error when directory is specified but not recursive (#10609)
# Description
Closes #10537. Basically error message was unhelpful, and this temporary
measure adds back the nice previous nushell error message. Ideally, we
would like to add a more permanent solution mentioned in the issue
[comments](https://github.com/nushell/nushell/issues/10537#issuecomment-1743686122),
but since we want to have `ucp` as `cp` on new release, this is hackier
but way simpler so this fix should do it.

Only downside is that now behavior differs from `uutils` in the sense
that:
```
uutils:
> cp a foo/ bar
ls bar
# foo/a

nushell:
>ucp a foo/ bar
# directory error (not copied) ....
```
So, since its non fatal error, uutils copies a, but nushell errors out
with nothing copied. If we go to option 3 mentioned above, then we can
decide what we want to do, and perhaps continue on a non fatal error.


# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- [X] `cargo fmt --all -- --check` to check standard code formatting
(`cargo fmt --all` applies these changes)
- [X] `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used`
to check that you're using the standard code style
- [X] `cargo test --workspace` to check that all tests pass (on Windows
make sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- [X] `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```

# After Submitting

---------

Co-authored-by: amtoine <stevan.antoine@gmail.com>
2023-10-06 18:59:46 +02:00
..
bytes Add long options for bits and bytes (#10601) 2023-10-05 18:45:28 +02:00
charting Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
conversions Add long options for conversions (#10602) 2023-10-05 18:46:13 +02:00
database Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
date Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
debug Use long options for debug (#10621) 2023-10-06 18:54:15 +02:00
env Fix editor config for reedline and config nu/env (#10535) 2023-09-29 16:36:03 +02:00
experimental Add functions for each Value case (#9736) 2023-07-21 08:20:33 -05:00
filesystem ucp: Change error when directory is specified but not recursive (#10609) 2023-10-06 18:59:46 +02:00
filters Use int type name consistently (#10579) 2023-10-03 18:24:32 +02:00
formats Use int type name consistently (#10579) 2023-10-03 18:24:32 +02:00
generators Use int type name consistently (#10579) 2023-10-03 18:24:32 +02:00
hash Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
help Add 'help escapes' command for quick reference of nushell string escapes (#10522) 2023-09-30 09:04:27 -05:00
math Use int type name consistently (#10579) 2023-10-03 18:24:32 +02:00
misc REFACTOR: move source out of deprecated commands (#9060) 2023-05-04 00:02:03 +02:00
network Add url decode command (#10611) 2023-10-05 18:43:58 +02:00
path Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
platform Bump dialoguer to 0.11.0 (#10510) 2023-09-26 18:00:16 +02:00
random Rename random integer to random int (#10520) 2023-09-28 11:47:05 +02:00
removed Rename misused "deprecation" to removal (#10000) 2023-08-15 07:17:31 +12:00
shells Fix usage for the exit command. (#9450) 2023-06-16 10:09:02 +02:00
strings Remove str replace --string after deprecation (#10064) 2023-09-19 15:54:20 +02:00
system Ps: add cwd column on linux and macos (#10347) 2023-09-14 08:10:15 -05:00
viewers Revert "Port command examples to long option" (#10597) 2023-10-04 09:41:13 +13:00
default_context.rs Add url decode command (#10611) 2023-10-05 18:43:58 +02:00
example_test.rs feat: Add unfold command (#10489) 2023-09-30 09:08:06 -05:00
lib.rs Move eval_hook to nu-cmd-base (#10146) 2023-08-29 23:46:50 +02:00
progress_bar.rs cp progress bar implementation (#8012) 2023-02-22 11:57:38 -08:00
sort_utils.rs Use slices directly instead of &Vec (#10328) 2023-09-12 11:38:20 +08:00