`move`-Command Tests, Refactor, Fix
fixes #11783
Description
Firstly Tests for the move Command have been added. Afterwards some duplicate Code has been removed and finally an error-message has been added for when a column is tried to be moved based on itself. This should fix #11783 .
To reiterate, the example of the initial issue now plays out as follows:
> {a: 1} | move a --after a
Error: nu::shell::incompatible_parameters
× Incompatible parameters.
╭─[entry #1:1:15]
1 │ {a: 1} | move a --after a
· ┬ ┬
· │ ╰── relative to itself
· ╰── Column cannot be moved
╰────
User-Facing Changes
The error message shown above.
Tests + Formatting
I added some Tests for the behavior of the command. If I should add more, please let me know but I added everything that came to mind when thinking about the command.
I am sorry for all the commits but somehow I am not getting all the clippy warnings on my local machine. If anyone knows what the problem could be please let me know (I am running cargo clippy --workspace -- -D warnings -D clippy::unwrap_used)
Other than my comment above I think this looks good. Thanks!
Great, I will change and commit it immediately.
Thanks for helping make nushell better!