/mvx

Primary LanguageRustMIT LicenseMIT

MVX

Purpose

The mvx command aims at providing a mv/cp tool modifying only file extension while keeping the basename constant and preventing such kind of mistake:

$ ls -1
light.md
$ mv light.md ligt.md.bak
$ ls -1
ligt.md.bak

Examples

To perform the same kind of change, mvx can be invoked with:

$ mvx light.md -a .bak
$ ls -1
light.md.bak

mvx allows also to make a copy instead of a move using the --copy switch:

$ mvx -c light.md -a .bak
$ ls
light.md
light.md.bak

One can also remove an extension with the --remove argument:

$ ls
light.md.bak
$ mvx light.md.bak -r .bak
$ ls
light.md

Installation

Copy the repository locally, then:

$ cargo build --release
$ cargo install --path . --root /wherever/you/want --no-track --force

If cpx is a link to mvx name, the program will perform as if the --copy flag was provided:

$ ln -s /wherever/you/want/mvx /wherever/you/want/cpx
$ ls
light.md.bak
$ /wherever/you/want/cpx light.md.bak -r .bak
$ ls -1
light.md
light.md.bak