# moove - 🚚 Manipulate file names and locations
[![Version][image-version]][url-version]
[![Downloads from crates.io][image-downloads-crates]][url-crates.io]
[![License][image-license]](#license-)
*moove* is a command line tool for renaming and moving files and directories using a text editor.
[🎨 Features](#features-) \|
[🚀 Usage](#usage-) \|
[📥 Getting started](#getting-started-) \|
[💙 Contributing](#contributing-) \|
[🌏 License](#license-)

## Features 🎨
- Displays file and directory names like [`ls`](https://man7.org/linux/man-pages/man1/ls.1.html) in a text editor,
and renames or moves them exactly as you edit them.
- A pre-compiled single executable without any dependencies.
- Supports Linux, Mac and Windows.
- Supports wildcard patterns, including Windows.
### Caveats ⚠
- Given paths have to be convertible to UTF-8.
- Collisions are detected *as much as possible*, but *not perfectly*.
Does not verify all paths such as hard links and symbolic links.
## Usage 🚀
```txt
Usage: moove [OPTIONS] [PATHS]...
Arguments:
[PATHS]... Paths or wildcard patterns to move
Options:
-v, --verbose Verbose output
-s, --sort Sort in the natural order
-a, --absolute Treat as absolute paths
-d, --directory Directories themselves, not their contents
-w, --with-hidden Include hidden files
-e, --exclude-pattern <PATTERN> Exclude regular expression pattern
-c, --copy Copy without moving
-u, --dry-run Dry-run
-o, --oops Abort in case of collision (prompt as default)
-f, --force Overwrite existing files without prompting
-F, --force-dir Overwrite existing directories without prompting (implies --force)
-q, --quiet No output to stdout/strerr even if error
-h, --help Print help
-V, --version Print version
```
- Displays file and directory names like [`ls`](https://man7.org/linux/man-pages/man1/ls.1.html) in a text editor.
- You can edit the list as you want to operate. The order of lines after editing corresponds to the original one. Empty lines will be ignored.
- Operations are canceled if you close the editor without saving.
- If a line starts with `//`, the file and directory (and its contents) will be removed regardless of modification of the remaining part of the line.
- Destination directories will be created automatically.
- In case of line number change or collision, asks whether to re-edit or abort. Aborts without asking if `--oops` is specified.
- With `--force`, an existing destination file (or symlink to a file) is overwritten without prompting. Errors if the destination is a directory or a symlink to a directory.
- With `--force-dir`, an existing destination directory (or symlink to a directory) is also overwritten: on move, the destination is removed and replaced; on copy, the contents are merged. Implies `--force` for file destinations. Errors if the source is a symlink to a directory.
### Configuration 🎚
- Default command line options can be specified by the environment variable `MOOVE_OPTIONS`.
- The default editor is searched in the following order.
- environment variable `VISUAL`
- environment variable `EDITOR`
- hardcoded lists
- platform-specific generic file openers
## Getting Started 📥
### Pre-compiled binaries
- Download the archive for your platform from the [latest release][url-latest-release].
- Release assets are built automatically for Linux, macOS, and Windows.
### Install by cargo
```sh
cargo install moove
```
## Alternatives
- [laurent22/massren](https://github.com/laurent22/massren)
- [itchyny/mmv](https://github.com/itchyny/mmv)
## Contributing 💙
Followings are used to build.
- [cargo-make](https://crates.io/crates/cargo-make/) as the task runner
- [cargo-dist](https://github.com/axodotdev/cargo-dist) for release packaging and GitHub Releases
### Testing and Building 🔨
- To test,
```txt
cargo make test
```
- To build binaries for release,
```txt
cargo make
```
The binary for your local environment will be built in `target/release`.
## TODOs ✅
- Package for various platforms
- Exclude .gitignore option
- Logging
- Recursive option
- Maximum depth option
- Depth option
## License 🌏
Licensed under either of
- [Apache License, Version 2.0][url-license-apache] or
[https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)
- [MIT license][url-license-mit] or
[https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.
© 2023 [Urin](https://github.com/urin)
[image-license]: https://img.shields.io/badge/license-MIT%2FApache--2.0-lightgrey?style=flat
[image-downloads-crates]: https://img.shields.io/crates/d/moove?label=downloads&style=flat
[image-version]: https://img.shields.io/crates/v/moove.svg?style=flat
[url-license-mit]: https://github.com/urin/moove/blob/main/LICENSE-MIT
[url-license-apache]: https://github.com/urin/moove/blob/main/LICENSE-APACHE
[url-latest-release]: https://github.com/urin/moove/releases/latest
[url-releases]: https://github.com/urin/moove/releases
[url-version]: https://crates.io/crates/moove/versions
[url-crates.io]: https://crates.io/crates/moove